ask/celery — Issue #618: Task celery.backend_cleanup
Author: avisual
Created: 2012-02-22 09:09:50+00:00
State: open

[2012-02-22 04:00:00,145: ERROR/MainProcess] Task celery.backend_cleanup[f4ec7420-06ad-4c77-b95b-7cfa094a2a3a] raised exception: TypeError("unsupported operand type(s) for -: 'datetime.datetime' and 'int'",)
Traceback (most recent call last):
File "/usr/local/lib/python2.6/site-packages/celery/execute/trace.py", line 47, in trace
return cls(states.SUCCESS, retval=fun(*args, **kwargs))
File "/usr/local/lib/python2.6/site-packages/celery/app/task/__init__.py", line 247, in __call__
return self.run(*args, **kwargs)
File "/usr/local/lib/python2.6/site-packages/celery/app/__init__.py", line 175, in run
return fun(*args, **kwargs)
File "/usr/local/lib/python2.6/site-packages/celery/task/__init__.py", line 93, in backend_cleanup
backend_cleanup.backend.cleanup()
File "/usr/local/lib/python2.6/site-packages/djcelery/backends/database.py", line 56, in cleanup
model._default_manager.delete_expired(self.expires)
File "/usr/local/lib/python2.6/site-packages/djcelery/managers.py", line 109, in delete_expired
self.get_all_expired(expires).delete()
File "/usr/local/lib/python2.6/site-packages/djcelery/managers.py", line 105, in get_all_expired
return self.filter(date_done__lt=datetime.now() - expires)
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'int'
Traceback (most recent call last):
File "/usr/local/lib/python2.6/site-packages/celery/execute/trace.py", line 47, in trace
return cls(states.SUCCESS, retval=fun(*args, **kwargs))
File "/usr/local/lib/python2.6/site-packages/celery/app/task/__init__.py", line 247, in __call__
return self.run(*args, **kwargs)
File "/usr/local/lib/python2.6/site-packages/celery/app/__init__.py", line 175, in run
return fun(*args, **kwargs)
File "/usr/local/lib/python2.6/site-packages/celery/task/__init__.py", line 93, in backend_cleanup
backend_cleanup.backend.cleanup()
File "/usr/local/lib/python2.6/site-packages/djcelery/backends/database.py", line 56, in cleanup
model._default_manager.delete_expired(self.expires)
File "/usr/local/lib/python2.6/site-packages/djcelery/managers.py", line 109, in delete_expired
self.get_all_expired(expires).delete()
File "/usr/local/lib/python2.6/site-packages/djcelery/managers.py", line 105, in get_all_expired
return self.filter(date_done__lt=datetime.now() - expires)
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'int'

I am seeing this in my logs