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

Commit 0710b0c

Browse files
committed
simplied code to grab first retry_info
1 parent fc5cada commit 0710b0c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

google/cloud/bigtable/data/_metrics/tracked_retry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def wrapper(exc: Exception) -> None:
6565
operation.add_response_metadata({k: v for k, v in metadata})
6666
# check for RetryInfo:
6767
if exc.details:
68-
info_matches = [field for field in exc.details if isinstance(field, RetryInfo)]
69-
if info_matches:
70-
operation.backoff_generator.set_from_exception_info(info_matches[0])
68+
info = next((field for field in exc.details if isinstance(field, RetryInfo)), None)
69+
if info:
70+
operation.backoff_generator.set_from_exception_info(info)
7171
except Exception:
7272
# ignore errors in metadata collection
7373
pass

0 commit comments

Comments
 (0)