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

Periodic tasks can get queued with different default args/kargs #146

Closed
jkemp101 opened this issue Oct 1, 2019 · 0 comments
Closed

Periodic tasks can get queued with different default args/kargs #146

jkemp101 opened this issue Oct 1, 2019 · 0 comments
Assignees

Comments

@jkemp101
Copy link
Member

jkemp101 commented Oct 1, 2019

When tasktiger starts and automatically schedules periodic tasks the task ID is the hash of:
{"args": null, "func": "my_function", "kwargs": null}

If the same task is scheduled in a Python shell with my_function.delay() the hash is of:
{"args": [], "func": "my_function", "kwargs": {}}
which will be a different ID than the previous version. This can cause the same periodic task to be scheduled twice with two different IDs.

[] and {} are probably the more sane defaults. Two options to fix:

  • Force the hash to be None for [] and {} in gen_unique_id
  • Calculate the hash using [] and {} and have a migration to unschedule existing tasks that can be used before deploying the new version of TaskTiger so that two sets of periodic tasks don't end up scheduled.
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

No branches or pull requests

2 participants