芹菜坏幻数

2024-09-24 21:05:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我可以使用终端中的命令正常运行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
    }
}

Tags: inpyselfreturnlibusrlocalline