Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cleanup/remove-ga-wor…
Browse files Browse the repository at this point in the history
…kflows-step
  • Loading branch information
MartinFoka committed Nov 5, 2024
2 parents 8ab0063 + bd2118c commit 76a64f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/simple_worker/workers/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def fail_three_times() -> None:
Raises an exception on the first three executions and succeeds on the fourth.
"""
env_var_name: str = f'{self.__class__.__name__}_attempt_count'
attempt_count: int = int(os.getenv(env_var_name, 'O'))
attempt_count: int = int(os.getenv(env_var_name, '0'))

try:
if attempt_count < 3: # noqa: PLR2004
Expand Down
3 changes: 3 additions & 0 deletions frinx/common/worker/worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import annotations

import logging
import sys
import time
import traceback
from abc import abstractmethod
from functools import reduce
from json import JSONDecodeError
Expand Down Expand Up @@ -266,6 +268,7 @@ def execute_wrapper(self, task: RawTaskIO) -> Any:
logger.debug('Task result %s:', task_result)
return task_result
except Exception as error:
sys.stderr.write(traceback.format_exc())
increment_task_execution_error(metrics, task_type, error)
increment_uncaught_exception(metrics, task_type)
return self.exception_response_handler(
Expand Down

0 comments on commit 76a64f8

Please sign in to comment.