Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Extend simple task representation with name, type and duration
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranciszkiewicz committed May 23, 2017
1 parent 80ca856 commit 309cd55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions golem/task/taskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ def _simple_task_repr(states, task):
state = states.get(task.header.task_id)
return {
u'id': to_unicode(task.header.task_id),
u'name': to_unicode(task.task_definition.name),
u'type': to_unicode(task.task_definition.type),
u'duration': max(task.task_definition.full_task_timeout -
state.remaining_time, 0),
u'time_remaining': state.remaining_time,
u'subtasks': task.get_total_tasks(),
u'status': to_unicode(state.status),
Expand Down
1 change: 1 addition & 0 deletions tests/golem/task/test_taskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ def __build_tasks(cls, n):
for i in xrange(0, n):

task = Mock()
task.task_definition.full_task_timeout = 100
task.header.task_id = str(uuid.uuid4())
task.get_total_tasks.return_value = i + 2
task.get_progress.return_value = i * 10
Expand Down

0 comments on commit 309cd55

Please sign in to comment.