Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
django celerybeat计划年中月索引器索引超出范围_Django_Django Celery - Fatal编程技术网

django celerybeat计划年中月索引器索引超出范围

django celerybeat计划年中月索引器索引超出范围,django,django-celery,Django,Django Celery,我似乎无法为django celerybeat的时间表设定每年的月份。它不断抛出索引超出范围的错误 这是我的日程安排: # Annual task to permanently delete all transactions that are older # than 2 years old. 'annual-transaction-deletion': { 'task': 'project.tasks.annual_transactions_deletion', 'sched

我似乎无法为django celerybeat的时间表设定每年的月份。它不断抛出索引超出范围的错误

这是我的日程安排:

# Annual task to permanently delete all transactions that are older 
# than 2 years old.
'annual-transaction-deletion': {
    'task': 'project.tasks.annual_transactions_deletion',
    'schedule': crontab(hour='2', minute=0, day_of_month=1, month_of_year=1)
}
我已尝试将上面的年中月也设置为年中月=[1]和年中月='1'

以下堆栈跟踪打印在celerybeat日志中:

[2012-12-19 09:50:06,403: CRITICAL/MainProcess] celerybeat raised exception <type 'exceptions.IndexError'>: IndexError('list index out of range',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/apps/beat.py", line 100, in start_scheduler
beat.start()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 422, in start
interval = self.scheduler.tick()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 194, in tick
next_time_to_run = self.maybe_due(entry, self.publisher)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 172, in maybe_due
is_due, next_time_to_run = entry.is_due()
  File "/usr/local/lib/python2.7/dist-packages/djcelery/schedulers.py", line 65, in is_due
return self.schedule.is_due(self.last_run_at)
  File "/usr/local/lib/python2.7/dist-packages/celery/schedules.py", line 502, in is_due
rem_delta = self.remaining_estimate(last_run_at)
  File "/usr/local/lib/python2.7/dist-packages/celery/schedules.py", line 489, in remaining_estimate
next_hour, next_minute)
  File "/usr/local/lib/python2.7/dist-packages/celery/schedules.py", line 389, in _delta_to_next
roll_over()
  File "/usr/local/lib/python2.7/dist-packages/celery/schedules.py", line 372, in roll_over
months_of_year[datedata.moy],
IndexError: list index out of range
[2012-12-19 09:50:06403:CRITICAL/MainProcess]celerybeat引发异常:索引器('列表索引超出范围',)
回溯(最近一次呼叫最后一次):
文件“/usr/local/lib/python2.7/dist-packages/芹菜/apps/beat.py”,第100行,在start\u调度程序中
beat.start()
文件“/usr/local/lib/python2.7/dist-packages/芹菜/beat.py”,第422行,开头
interval=self.scheduler.tick()
文件“/usr/local/lib/python2.7/dist packages/芹菜/beat.py”,第194行,勾号
下一次运行=self.maybe(条目,self.publisher)
文件“/usr/local/lib/python2.7/dist-packages/芹菜/beat.py”,第172行,可能到期
是否到期,下一次运行=条目。是否到期()
文件“/usr/local/lib/python2.7/dist packages/djcelery/schedulers.py”,第65行,已到期
返回self.schedule.is_due(self.last_run_at)
文件“/usr/local/lib/python2.7/dist packages/芹菜/schedules.py”,第502行,已到期
rem_delta=自身剩余估计值(上次运行时)
文件“/usr/local/lib/python2.7/dist packages/cellery/schedules.py”,第489行,剩余部分
下一小时,下一分钟)
文件“/usr/local/lib/python2.7/dist-packages/芹菜/schedules.py”,第389行,下一行
翻滚
文件“/usr/local/lib/python2.7/dist packages/芹菜/schedules.py”,第372行,滚动
每年的月份[日期数据.moy],
索引器:列表索引超出范围

我有很多其他的工作安排,但不包括每年的月份。上述计划每年只需运行一次。我忍不住觉得这是芹菜库中的一个错误,但我渴望有人证明我错了。显然,如果它是一个bug,我不希望通过修改库文件来修复它。非常感谢您的帮助。

Django版本:1.4.3,芹菜版本:3.0.11(交叉幻灯片)