Skip to content

Commit

Permalink
Fit linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
catileptic committed Jun 6, 2024
1 parent 00de8e1 commit 1ea8ac3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def handle(self, task: Task, channel):
# exists in Redis in the "running" or "pending" lists.
should_execute = dataset.should_execute(task.task_id)
if should_execute or task_retry_count <= settings.WORKER_RETRY:
# Increase the counter of tasks that have failed but will be re-attempted
# Increase the num. of tasks that have failed but will be reattempted
if task_retry_count:
metrics.TASKS_FAILED.labels(
stage=task.operation,
Expand Down Expand Up @@ -531,9 +531,15 @@ def handle(self, task: Task, channel):
else:
reason = ""
if not should_execute:
reason = f"Task {task.task_id} was not in found either the Running nor Pending lists"
reason = (
f"Task {task.task_id} was not in found"
f"neither the Running nor Pending lists"
)
elif task_retry_count > settings.WORKER_RETRY:
reason = f"Task {task.task_id} was attempted more than {settings.WORKER_RETRY} times"
reason = (
f"Task {task.task_id} was"
f"attempted more than {settings.WORKER_RETRY} times"
)
# This task can be tracked as having failed permanently.
metrics.TASKS_FAILED.labels(
stage=task.operation,
Expand Down

0 comments on commit 1ea8ac3

Please sign in to comment.