diff --git a/src/hawk/client.py b/src/hawk/client.py index 4c9b84e..357046e 100644 --- a/src/hawk/client.py +++ b/src/hawk/client.py @@ -232,7 +232,7 @@ def delete_session(self, session_id: str) -> None: def _do() -> None: self._request("DELETE", f"/v1/sessions/{session_id}") - with_retry_sync(_do, self._retry_config) + return with_retry_sync(_do, self._retry_config) def list_messages( self, session_id: str, limit: int = 50, offset: int = 0 @@ -443,7 +443,7 @@ async def delete_session(self, session_id: str) -> None: async def _do() -> None: await self._request("DELETE", f"/v1/sessions/{session_id}") - await with_retry(_do, self._retry_config) + return await with_retry(_do, self._retry_config) async def list_messages( self, session_id: str, limit: int = 50, offset: int = 0 diff --git a/src/hawk/retry.py b/src/hawk/retry.py index bbd3cf8..be2e9ec 100644 --- a/src/hawk/retry.py +++ b/src/hawk/retry.py @@ -4,6 +4,7 @@ import asyncio import random +import time from dataclasses import dataclass, field from typing import TYPE_CHECKING, Callable, TypeVar @@ -113,8 +114,6 @@ def with_retry_sync( Raises: The last exception if all retries are exhausted. """ - import time - if config is None: config = DEFAULT_RETRY_CONFIG