Skip to content

Commit

Permalink
Batches: Do not attempt to cancel non-existing tref. Closes celery#1984
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Apr 15, 2014
1 parent 5383f21 commit 7289933
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion celery/contrib/batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def _do_flush(self):
self.flush(requests)
if not requests:
logger.debug('Batches: Cancelling timer: Nothing in buffer.')
self._tref.cancel() # cancel timer.
if self._tref:
self._tref.cancel() # cancel timer.
self._tref = None

def apply_buffer(self, requests, args=(), kwargs={}):
Expand Down

0 comments on commit 7289933

Please sign in to comment.