Skip to content

Commit

Permalink
Adds a deprecation warning for the wait() method (#682)
Browse files Browse the repository at this point in the history
* Adds a deprecation warning for the wait() method

Signed-off-by: Elena Kolevska <[email protected]>

* Ruff

Signed-off-by: Elena Kolevska <[email protected]>

---------

Signed-off-by: Elena Kolevska <[email protected]>
  • Loading branch information
elena-kolevska authored Mar 6, 2024
1 parent 0b7aafd commit dea724d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dapr/aio/clients/grpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,12 @@ async def wait(self, timeout_s: float):
Args:
timeout_s (float): timeout in seconds
"""
warn(
'The wait method is deprecated. A health check is now done automatically on client '
'initialization.',
DeprecationWarning,
stacklevel=2,
)

start = time.time()
while True:
Expand Down
6 changes: 6 additions & 0 deletions dapr/clients/grpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,12 @@ def wait(self, timeout_s: float):
Args:
timeout_s (float): timeout in seconds
"""
warn(
'The wait method is deprecated. A health check is now done automatically on client '
'initialization.',
DeprecationWarning,
stacklevel=2,
)
start = time.time()
while True:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
Expand Down

0 comments on commit dea724d

Please sign in to comment.