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

Commit d32dc65

Browse files
committed
chore(format): ruff
Signed-off-by: Casper Nielsen <casper@diagrid.io>
1 parent 46f51d1 commit d32dc65

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

durabletask/internal/shared.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ def get_grpc_channel(
102102

103103
merged_options = _merge_grpc_options(options)
104104
if secure_channel:
105-
channel = grpc.secure_channel(host_address, grpc.ssl_channel_credentials(), options=merged_options)
105+
channel = grpc.secure_channel(
106+
host_address, grpc.ssl_channel_credentials(), options=merged_options
107+
)
106108
else:
107109
channel = grpc.insecure_channel(host_address, options=merged_options)
108110

durabletask/worker.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,7 @@ def create_fresh_connection():
407407
conn_retry_count = 0
408408
self._logger.info(f"Created fresh connection to {self._host_address}")
409409
except Exception as e:
410-
detail = getattr(e, "details", lambda: str(e))()
411-
self._logger.warning("Failed to create connection: %s", detail)
410+
self._logger.warning(f"Failed to create connection: {e}")
412411
current_channel = None
413412
self._current_channel = None
414413
current_stub = None
@@ -523,7 +522,9 @@ def stream_reader():
523522
self._logger.warning(
524523
"Stream reader: RPC error (code=%s): %s",
525524
rpc_error.code(),
526-
rpc_error.details() if hasattr(rpc_error, "details") else rpc_error,
525+
rpc_error.details()
526+
if hasattr(rpc_error, "details")
527+
else rpc_error,
527528
)
528529
break
529530
except Exception as stream_error:
@@ -645,7 +646,9 @@ def stream_reader():
645646
if should_invalidate:
646647
invalidate_connection()
647648
error_code = rpc_error.code() # type: ignore
648-
error_detail = rpc_error.details() if hasattr(rpc_error, "details") else str(rpc_error)
649+
error_detail = (
650+
rpc_error.details() if hasattr(rpc_error, "details") else str(rpc_error)
651+
)
649652

650653
if error_code == grpc.StatusCode.CANCELLED:
651654
self._logger.info(f"Disconnected from {self._host_address}")
@@ -775,9 +778,7 @@ def _handle_grpc_execution_error(self, rpc_error: grpc.RpcError, request_type: s
775778
rpc_error.details() if hasattr(rpc_error, "details") else rpc_error,
776779
)
777780
else:
778-
self._logger.exception(
779-
f"Failed to deliver {request_type} result: {rpc_error}"
780-
)
781+
self._logger.exception(f"Failed to deliver {request_type} result: {rpc_error}")
781782

782783
def _execute_orchestrator(
783784
self,

0 commit comments

Comments
 (0)