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

Timeouts given for async_task do not work if timeout value for cluster is None (the default) #335

Closed
janneronkko opened this issue Jan 27, 2019 · 0 comments

Comments

@janneronkko
Copy link
Contributor

If timeout in cluster configuration is set to None (the default) or 0 (zero) the timeouts given as async_task parameter (for example, async_task('function', timeout=10)) is ignored.

You can test this with the following steps:

  1. Set the timeout for cluster to None (or leave the timeout configuration parameter out)
  2. Start shell: python manage.py shell
  3. Run the following code:
from django_q.tasks import async_tast

async_task('time.sleep', 10, timeout=2)

If you look the output of python manage.py qcluster you will see that the task does not timeout but finishes after 10 seconds.

janneronkko added a commit to janneronkko/django-q that referenced this issue Jan 27, 2019
… to None (the default)

The cluster timeout configuration default value None is documented to mean
tasks never timeout out. Also the documentation states that the timeout
can be overridden for individual tasks.

With the old implementation the timeout parameter given to async_task was
not honored if the cluster timeout was set to None.

Fixes: Koed00#335
@Koed00 Koed00 closed this as completed in 0e2df88 Jan 27, 2019
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

1 participant