Ignore a job when there isn't a "data" key available.

main
Vincent Driessen 12 years ago
parent 223e09f4fe
commit 501a3870e1

@ -256,7 +256,7 @@ class Job(object):
"""
key = self.key
obj = self.connection.hgetall(key)
if not obj:
if len(obj) == 0:
raise NoSuchJobError('No such job: %s' % (key,))
def to_date(date_str):
@ -265,7 +265,11 @@ class Job(object):
else:
return times.to_universal(date_str)
self.data = obj.get('data')
try:
self.data = obj['data']
except KeyError:
raise NoSuchJobError('Unexpected job format: {0}'.format(obj))
try:
self._func_name, self._instance, self._args, self._kwargs = unpickle(self.data)
except UnpickleError:

Loading…
Cancel
Save