Skip to content

Fix DatabaseScheduler behavior when schedule is changed from interval to crontab #351

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

Merged
merged 2 commits into from
May 10, 2017
Merged

Conversation

dmitry-mukhin
Copy link
Contributor

ModelEntry was not checking if there is interval value in DB when updating scheduled task from settings dict.
The result was unexpected (and frustrating) behavior when one decides that he need more fine grained control over execution schedule and change only schedule from timedelta to crontab.

I propose to set schedule fields to None prior setting a proper value.

@auvipy auvipy merged commit d87fdb4 into celery:master May 10, 2017
@georgepsarakis
Copy link

@dmitry-mukhin could you please explain the call to function _next_id in https://github.com/celery/django-celery/pull/351/files#diff-fb04340bb23860bdd25c44003fd3430eR104 ? It seems undefined.

@dmitry-mukhin
Copy link
Contributor Author

@georgepsarakis, as you can see the PR was created few years ago. It's possible that _next_id was defined in that scope back then :)

_next_id = lambda: next(_next_id_get)

_next_id should be changed to next(_ids), as far as I understand

see
https://github.com/celery/django-celery/blob/master/djcelery/tests/test_schedulers.py#L105

maxmalysh pushed a commit to maxmalysh/django-celery that referenced this pull request Jul 29, 2019
… to crontab (celery#351)

* add regression test for ModelEntry.from_entry

* fix ModelEntry.from_entry and ModelEntry.__repr__ behavior
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.

3 participants