0

Call the follow code

 tasks.update_address_location.apply_async((address_obj.id), countdown = 10)

However the task executes immediately on the queue. It workings so must other possibilities I've rules out. Thought someone might have an answer

capp = Celery('async', backend='redis://localhost:6379/0',
              broker='redis://localhost:6379/0', include=['app.async.tasks'])

# Optional configuration, see the application user guide.
capp.config_from_object(celeryconfig)
capp.conf.update(
    CELERY_TASK_RESULT_EXPIRES=3600,
)

if __name__ == '__main__':
    capp.start()

and celery is called as such:

celery multi stop worker  -A app.async.celery_app:capp --beat --loglevel=debug --pidfile=celery.pid --logfile=celery.log

The output in the celery.log is consistent and successful, but there no delay in there.

silverdagger
  • 1,124
  • 13
  • 37

1 Answers1

2

A quirkof python - (x) == x - a tuple with one element must contain a comma - (x,)

Do this:

apply_async((address_obj.id,), {}, countdown=10)
Community
  • 1
  • 1
scytale
  • 12,346
  • 3
  • 32
  • 46