[Solved]-Celerybeat automatically disables periodic task

15👍

I had the same issue. Make sure the arguments are JSON formatted. For example, try setting the positional args to [1, false] — lowercase ‘false’ — I just tested it on a django-celery instance (version 2.2.4) and it worked.

For the keyword args, use something like {“name”: “aldarund”}

👤Evan

9👍

I got the same problem too.

With the description of PeriodicTask models in djcelery (“JSON encoded positional arguments”), same as Evan answer. I try using python json lib to encode before save.

And this work with me

import json 
o = PeriodicTask()
o.kwargs = json.dumps({'myargs': 'hello'})
o.save()

celery version 3.0.11

👤Hardy

0👍

CELERYBEAT_SCHEDULE = {
    "example": {
        "task": "<task.module.path>",
        "schedule": crontab(),
        "enable": False
    },
}

I tried and it worked.I run on celery beat v5.1.2

Leave a comment