Skip to content

Commit 5318fb1

Browse files
committed
Fixes #210
1 parent b973c29 commit 5318fb1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

djcelery/snapshot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ def _handle_tasks():
145145
_handle_tasks()
146146

147147
def on_cleanup(self):
148-
dirty = sum(self.TaskState.objects.expire_by_states(states, expires)
149-
for states, expires in self.expire_states.items())
148+
expired = (self.TaskState.objects.expire_by_states(states, expires)
149+
for states, expires in self.expire_states.items())
150+
dirty = sum(item for item in expired if item is not None)
150151
if dirty:
151152
debug('Cleanup: Marked %s objects as dirty.', dirty)
152153
self.TaskState.objects.purge()

0 commit comments

Comments
 (0)