Skip to content

Commit

Permalink
Populate Task.ts field in Task.from_id fn (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vojta Udrzal committed Apr 20, 2021
1 parent 3ba32e1 commit 019bf18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasktiger/task.py
Expand Up @@ -441,15 +441,14 @@ def from_id(self, tiger, queue, state, task_id, load_executions=0):
)
(
serialized_data,
is_queued,
score,
serialized_executions,
) = pipeline.execute()
else:
serialized_data, is_queued = pipeline.execute()
serialized_data, score = pipeline.execute()
serialized_executions = []

# XXX: No timestamp for now
if serialized_data and is_queued:
if serialized_data and score:
data = json.loads(serialized_data)
executions = [json.loads(e) for e in serialized_executions if e]
return Task(
Expand All @@ -458,6 +457,7 @@ def from_id(self, tiger, queue, state, task_id, load_executions=0):
_data=data,
_state=state,
_executions=executions,
_ts=datetime.datetime.utcfromtimestamp(score),
)
else:
raise TaskNotFound('Task {} not found.'.format(task_id))
Expand Down

0 comments on commit 019bf18

Please sign in to comment.