MCPcopy Index your code
hub / github.com/google/adk-python / _attempt_retry

Method _attempt_retry

src/google/adk/workflow/_node_runner.py:172–188  ·  view source on GitHub ↗

Checks if node should retry and sleeps if so.

(
      self, e: Exception, ctx: Context, attempt_count: int
  )

Source from the content-addressed store, hash-verified

170 attempt_count += 1
171
172 async def _attempt_retry(
173 self, e: Exception, ctx: Context, attempt_count: int
174 ) -> bool:
175 """Checks if node should retry and sleeps if so."""
176 from ._node_state import NodeState
177 from .utils._retry_utils import _get_retry_delay
178 from .utils._retry_utils import _should_retry_node
179
180 node_state = NodeState(attempt_count=attempt_count)
181
182 if not _should_retry_node(e, self._node.retry_config, node_state):
183 return False
184
185 delay = _get_retry_delay(self._node.retry_config, node_state)
186
187 await asyncio.sleep(delay)
188 return True
189
190 def _create_child_context(
191 self,

Callers 1

runMethod · 0.95

Calls 3

NodeStateClass · 0.85
_should_retry_nodeFunction · 0.85
_get_retry_delayFunction · 0.85

Tested by

no test coverage detected