0

I have a celery task which I call using the countdown keyword.

def plan_my_task():
    countdown = some_computation_function()     #result is a positive integer
    res = my_task.apply_async(args=[some_arg], countdown=countdown)

@task
def my_task(some_arg):
    do_something()

In my logs in see something like

[2013-11-14 01:22:31,516: INFO/MainProcess] Received task: my_module.my_task[d5d36a59-b88a-43cb-b7ac-bf0737cdab2c] eta:[2013-11-14 01:16:17.513310+01:00]

As you can see, the eta is set before the current time!

I use celery 3.1.

3
  • You say that countdown is positive, but just to be sure, if you were to replace countdown=countdown with countdown=abs(countdown) do you still see this in the logs?
    – Gerrat
    Nov 13, 2013 at 23:03
  • Also, when you say countdown is positive, just curious...how big is it typically...in the tens, or thousands?
    – Gerrat
    Nov 13, 2013 at 23:04
  • Typically in the tens. I tried to hardcode it to 30, with no result
    – Vincent
    Nov 14, 2013 at 9:24

1 Answer 1

0

I don't actually use celery, but from the API, it looks like countdown is a keyword parameter to both Task.apply_async, or Task.retry. It's not a keyword for a function just decorated with @task

EDIT: According to this answer, it may be that the log time is in local time, and the ETA time is in UTC time. This might be possible if countdown was in the thousands (to give us a few hours off instead of the few minutes it looks like its off comparing the times directly)

1
  • You are absolutely right. However, the apply_async call was missing in my question only, not in my actual code -- sorry. Fixed it.
    – Vincent
    Nov 13, 2013 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.