Duplicated tasks after time change

2019-07-27 11:50发布

I don't know exactly why, but I am getting duplicated tasks. I thing this may be related with time change of the last weekend (The clock was delayed for an hour in the system).

The first task should not be executed, since I say explicitly hour=2. Any idea why this happens?

[2017-11-01 01:00:00,001: INFO/Beat] Scheduler: Sending due task every-first-day_month (app.users.views.websites_down)
[2017-11-01 02:00:00,007: INFO/Beat] Scheduler: Sending due task every-first-day_month (app.users.views.websites_down)

from celery.schedules import crontab

CELERYBEAT_SCHEDULE = {
    'every-first-day_month': {
        'task': 'app.users.views.websites_down',
        'schedule': crontab(hour=2, minute=0, day_of_month=1),
    }
}

CELERY_TIMEZONE = "Europe/Lisbon"

0条回答
登录 后发表回答