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

Async argument 'timeout' fails if broker timeout is set to None #125

Closed
aaronkurtz opened this issue Dec 8, 2015 · 0 comments
Closed

Async argument 'timeout' fails if broker timeout is set to None #125

aaronkurtz opened this issue Dec 8, 2015 · 0 comments
Labels

Comments

@aaronkurtz
Copy link

I'm using the 'orm' as a broker, but I suspect this will hit other brokers as well.

If the broker's timeout is set to None, as is the default, passing 'timeout' as an argument to async doesn't set the timeout properly. Once the broker has a timeout set, then the timeout can be overridden.

  Q_CLUSTER = { 
      'name': 'DjangoORM',
      'orm': 'default',
     'retry': 600,
  }
def block():
  import time
  while True:
    print("BLOCKING")
    time.sleep(1)
async(block, timeout=3)

The worker will never timeout. If timeout was set to something, then the worker times out in 3 seconds.

From what I can tell, setting timeout to -1 allows you to never timeout by default and to override it with the argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants