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 <elena@kolevska.com>

* Ruff

Signed-off-by: Elena Kolevska <elena@kolevska.com>

---------

Signed-off-by: Elena Kolevska <elena@kolevska.com>
  • Loading branch information
elena-kolevska committed Apr 24, 2024
1 parent aacdd6f commit 34be94f
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 @@ -1548,6 +1548,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 @@ -1525,6 +1525,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 34be94f

Please sign in to comment.