芹菜在码头工人坏魔术数

时间:2019-03-11 14:55:56

标签: python django docker celery

我可以使用终端中的命令正常运行celery beat,但是当我与docker一起运行时,出现以下错误:

[2019-03-11 11:46:27,327: INFO/MainProcess] beat: Starting...
celery_beat_taxithe | [2019-03-11 11:46:27,489: ERROR/MainProcess] Removing corrupted schedule file 'celerybeat-schedule': error('Bad magic number',)
celery_beat_taxithe | Traceback (most recent call last):
celery_beat_taxithe |   File "/usr/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 42, in __get__
celery_beat_taxithe |     return obj.__dict__[self.__name__]
celery_beat_taxithe | KeyError: 'scheduler'
celery_beat_taxithe | 
celery_beat_taxithe | During handling of the above exception, another exception occurred:
celery_beat_taxithe | 
celery_beat_taxithe | Traceback (most recent call last):
celery_beat_taxithe |   File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 476, in setup_schedule
celery_beat_taxithe |     self._store = self._open_schedule()
celery_beat_taxithe |   File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 466, in _open_schedule
celery_beat_taxithe |     return self.persistence.open(self.schedule_filename, writeback=True)
celery_beat_taxithe |   File "/usr/local/lib/python3.6/shelve.py", line 243, in open
celery_beat_taxithe |     return DbfilenameShelf(filename, flag, protocol, writeback)
celery_beat_taxithe |   File "/usr/local/lib/python3.6/shelve.py", line 227, in __init__
celery_beat_taxithe |     Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
celery_beat_taxithe |   File "/usr/local/lib/python3.6/dbm/__init__.py", line 94, in open
celery_beat_taxithe |     return mod.open(file, flag, mode)
celery_beat_taxithe | _gdbm.error: Bad magic number

我对芹菜的设置是:

CELERY_BEAT_SCHEDULE = {
    'driver_monitor_update_latlng': {
        'task': 'api.tasks.driver.turn_offline_driver',
        'schedule': 30.0 # a cada 30 seconds
    }
}

1 个答案:

答案 0 :(得分:0)

尝试从30.0中删除.0。可能不是问题,但这与您的电话号码或处理方式有关。