我的设置包括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]
您是否遵循了django/cerele集成的新指南?http://docs.celeryproject.org/en/master/django/first-steps-with-django.html
我将我的项目转换为不再调用djcele.setup_loader(),而是现在在{project}/{program}/celery.py 下有一个celery.py
此外,您的CELERY_RESULT_BACKEND设置为什么?我把我的设置为djcele.backends.database:DatabaseBackend
你的大钟漂移可能与此有关吗?你试过同步时钟吗?
我正在使用celeycam运行django 1.6.1,没有任何问题。