我的设置包括django 1.5.1,芹菜3.1.0和redis作为后端
$ python manage.py celerycam -b 'redis://localhost:6379/0'
使celerycam运行,但它继续对以下内容进行抨击:
TransactionManagementError: This code isn't under transaction management
[2013-11-19 15:19:44,097: ERROR/MainProcess] Error in timer: TransactionManagementError("This code isn't under transaction management",)
Traceback (most recent call last):
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/kombu/async/timer.py", line 166, in apply_entry
entry()
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/kombu/async/timer.py", line 64, in __call__
return self.fun(*self.args, **self.kwargs)
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/kombu/async/timer.py", line 127, in _reschedules
return fun(*args, **kwargs)
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/celery/events/snapshot.py", line 73, in capture
self.state.freeze_while(self.shutter, clear_after=self.clear_after)
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/celery/events/state.py", line 293, in freeze_while
return fun(*args, **kwargs)
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/celery/events/snapshot.py", line 70, in shutter
self.on_shutter(self.state)
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/djcelery/snapshot.py", line 129, in on_shutter
transaction.commit()
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/transaction.py", line 152, in commit
connection.commit()
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/__init__.py", line 242, in commit
self.set_clean()
File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/__init__.py", line 184, in set_clean
raise TransactionManagementError("This code isn't under transaction management")
TransactionManagementError: This code isn't under transaction management
[2013-11-19 15:19:45,010: WARNING/MainProcess] Substantial drift from celery@Lyn.local may mean clocks are out of sync. Current drift is
50400 seconds. [orig: 2013-11-19 15:19:45.010442 recv: 2013-11-19 01:19:45.009564]
答案 0 :(得分:1)
您是否遵循了django /芹菜整合的新指南? http://docs.celeryproject.org/en/master/django/first-steps-with-django.html
我将我的项目转换为不再调用djcelery.setup_loader(),而是现在在{project} / {project} /celery.py
下有一个celery.py您的CELERY_RESULT_BACKEND设置为什么?我将我的设置设置为djcelery.backends.database:DatabaseBackend
您的大时钟漂移可能与它有关吗?你试过同步时钟吗?
我正在使用celerycam运行django 1.6.1而没有任何问题。