我django-crontab
每天都在我的服务器上运行一个函数。当我添加python manage.py crontab add
一切正常的 cron 时,我可以看到 crons 并且它们正常执行(我已经测试它们每分钟都在运行并且它们按照我的意愿执行)。问题是第二天它总是抛出这个错误:
RuntimeError: No job with hash bdd84e8eebbbbc48c5d39e0245c78c93 found. It
seems the crontab is out of sync with your settings.CRONJOBS. Run "python
manage.py crontab add" again to resolve this issue!`
我设置了CRONTAB_DJANGO_PROJECT_NAME
andCRONTAB_DJANGO_MANAGE_PATH
因为我有一个本地manage.py
.
似乎它以某种方式从一天到另一天丢失了哈希。这是我的设置:
CRONJOBS = [
('0 7 * * 1-5', 'api.cron.email_to_late_docs', '>> {}'.format(BASE_DIR + '/logs/log_{:%d_%m_%Y}.log'.format(time.now()))),
('0 7 * * 1-5', 'api.cron.email_ten_days_before', '>> {}'.format(BASE_DIR + 'logs/log_{:%d_%m_%Y}.log'.format(time.now())))
]
CRONTAB_DJANGO_PROJECT_NAME = 'public_html'
CRONTAB_DJANGO_MANAGE_PATH = BASE_DIR + '/manage_local.py'
以前有人遇到过这个错误吗?