Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: Implement custom RunScheduler #16

Merged
merged 19 commits into from
Jun 4, 2024

Conversation

yashlamba
Copy link
Member

@yashlamba yashlamba commented May 24, 2024

@yashlamba yashlamba marked this pull request as draft May 24, 2024 09:06
@yashlamba yashlamba force-pushed the scheduler branch 2 times, most recently from ced82ec to 19abf92 Compare May 24, 2024 09:34
Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some minor comments

invenio_jobs/models.py Outdated Show resolved Hide resolved
"""Initialize the database scheduler."""
Scheduler.__init__(self, *args, **kwargs)

def get_schedule(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: can you separate in a comment section which methods are "internal" and which ones are required by Celery? To avoid having to go through the Celery docs/code + other implementations to figure this out.


def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Initialize the database scheduler."""
Scheduler.__init__(self, *args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Scheduler.__init__(self, *args, **kwargs)
super().__init__(self, *args, **kwargs)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it has to be done like this, perhaps leave a comment in the code ?

@yashlamba yashlamba force-pushed the scheduler branch 2 times, most recently from b2d4f73 to 99aa922 Compare May 27, 2024 14:52
invenio_jobs/models.py Outdated Show resolved Hide resolved
invenio_jobs/services/scheduler.py Outdated Show resolved Hide resolved
invenio_jobs/utils.py Outdated Show resolved Hide resolved
@yashlamba yashlamba marked this pull request as ready for review May 28, 2024 07:07
@yashlamba yashlamba force-pushed the scheduler branch 2 times, most recently from b88e1f4 to 1c513b2 Compare May 29, 2024 15:41
@yashlamba
Copy link
Member Author

Rebased on top of #14

@yashlamba yashlamba force-pushed the scheduler branch 3 times, most recently from 85693ab to e1f0281 Compare May 31, 2024 12:51
invenio_jobs/models.py Outdated Show resolved Hide resolved
invenio_jobs/services/scheduler.py Outdated Show resolved Hide resolved
invenio_jobs/services/scheduler.py Show resolved Hide resolved

def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Initialize the database scheduler."""
Scheduler.__init__(self, *args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it has to be done like this, perhaps leave a comment in the code ?

invenio_jobs/services/scheduler.py Show resolved Hide resolved
invenio_jobs/services/scheduler.py Show resolved Hide resolved
invenio_jobs/services/scheduler.py Show resolved Hide resolved
invenio_jobs/tasks.py Show resolved Hide resolved
invenio_jobs/tasks.py Outdated Show resolved Hide resolved
@yashlamba yashlamba force-pushed the scheduler branch 2 times, most recently from abd68db to 1d204a2 Compare June 3, 2024 15:21
@alejandromumo alejandromumo merged commit 894fd96 into inveniosoftware:master Jun 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Celerybeat custom scheduler
3 participants