Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jleaniz committed Oct 1, 2024
1 parent cc2fa96 commit 077779f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions turbinia/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,6 @@ def process_result(self, task_result: workers.TurbiniaTaskResult):
f'from {task_result.worker_name} executed with status '
f'[{task_result.status}]')

task_key = self.state_manager.redis_client.build_key_name(
'task', task_result.id)
self.state_manager.redis_client.set_attribute(
task_key, 'successful', 'false')

if not isinstance(task_result.evidence, list):
log.warning(
f'Task {task_result.task_id} {task_result.task_name} '
Expand Down
7 changes: 7 additions & 0 deletions turbinia/workers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,14 @@ def run_wrapper(self, evidence):
try:
evidence = evidence_decode(evidence)
self.result = self.setup(evidence)
# Call update_task_status to update status
# We cannot call update_task() here since it will clobber previously
# stored data by the Turbinia server when the task was created, which is
# not present in the TurbiniaTask object the worker currently has in its
# runtime.
self.update_task_status(self, 'queued')
# Beucase of the same reason, we perform a single attribute update
# for the worker name.
task_key = self.state_manager.redis_client.build_key_name('task', self.id)
self.state_manager.redis_client.set_attribute(
task_key, 'worker_name', json.dumps(worker_name))
Expand Down

0 comments on commit 077779f

Please sign in to comment.