2

I have a period task which schedule is got from database
Because we want the value can be changed by user

app.conf.CELERYBEAT_SCHEDULE = {
    'do_something': {
        'task': 'celery_task.tasks.do_something',
        'schedule': timedelta(seconds=get_setting()),
        'options': { 'queue': 'do_something',
                     'expires':get_setting()}
    },

When I execute celery beat -A project --loglevel=INFO
it run the task by every timedelta(seconds=get_setting()

But when I change the time in database
The task still use old schedule time
How can I let it use new schedule time????
Could it possible without restart celery beat??

user2492364
  • 6,543
  • 22
  • 77
  • 147

1 Answers1

0

Celery offers the option to build a custom scheduler. You can read about it here. Also, you can see examples in this SE question and this github repository.

Shortly, you need to implement a new scheduler that syncs entries from a DB. Good luck!

Community
  • 1
  • 1
Doron Cohen
  • 1,026
  • 8
  • 13