Skip to content

Commit

Permalink
task-failed event did not repr exception anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Aug 18, 2012
1 parent c9e77f7 commit df4da86
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions celery/worker/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def terminate(self, pool, signal=None):
self._terminate_on_ack = pool, signal

def _announce_revoked(self, reason, terminated, signum, expired):
self.send_event('task-revoked', uuid=self.id,
self.send_event('task-revoked',
terminated=terminated, signum=signum, expired=expired)
if self.store_errors:
self.task.backend.mark_as_revoked(self.id, reason)
Expand All @@ -274,7 +274,7 @@ def revoked(self):

def send_event(self, type, **fields):
if self.eventer and self.eventer.enabled:
self.eventer.send(type, **fields)
self.eventer.send(type, uuid=self.id, **fields)

def on_accepted(self, pid, time_accepted):
"""Handler called when task is accepted by worker pool."""
Expand All @@ -283,7 +283,7 @@ def on_accepted(self, pid, time_accepted):
task_accepted(self)
if not self.task.acks_late:
self.acknowledge()
self.send_event('task-started', uuid=self.id, pid=pid)
self.send_event('task-started', pid=pid)
if _does_debug:
debug('Task accepted: %s[%s] pid:%r', self.name, self.id, pid)
if self._terminate_on_ack is not None:
Expand Down Expand Up @@ -319,7 +319,7 @@ def on_success(self, ret_value, now=None):
if self.eventer and self.eventer.enabled:
now = time.time()
runtime = self.time_start and (time.time() - self.time_start) or 0
self.send_event('task-succeeded', uuid=self.id,
self.send_event('task-succeeded',
result=safe_repr(ret_value), runtime=runtime)

if _does_info:
Expand All @@ -335,7 +335,7 @@ def on_retry(self, exc_info):
if self.task.acks_late:
self.acknowledge()

self.send_event('task-retried', uuid=self.id,
self.send_event('task-retried',
exception=safe_repr(exc_info.exception.exc),
traceback=safe_str(exc_info.traceback))

Expand Down Expand Up @@ -367,7 +367,7 @@ def on_failure(self, exc_info):
def _log_error(self, einfo):
einfo.exception = get_pickled_exception(einfo.exception)
exception, traceback, exc_info, internal, sargs, skwargs = (
einfo.exception,
safe_repr(einfo.exception),
safe_str(einfo.traceback),
einfo.exc_info,
einfo.internal,
Expand All @@ -377,7 +377,7 @@ def _log_error(self, einfo):
format = self.error_msg
description = 'raised exception'
severity = logging.ERROR
self.send_event('task-failed', uuid=self.id,
self.send_event('task-failed',
exception=exception,
traceback=traceback)

Expand Down

0 comments on commit df4da86

Please sign in to comment.