Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverBzH committed Sep 30, 2024
1 parent 4772f24 commit 02d2511
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions avatar/pandora_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import grpc.aio
import logging

import time

from avatar.metrics.interceptors import aio_interceptors
from avatar.metrics.interceptors import interceptors
from bumble import pandora as bumble_server
Expand Down Expand Up @@ -120,7 +118,11 @@ async def reset(self) -> None:
)
return
except grpc.aio.AioRpcError as e:
if e.code() in (grpc.StatusCode.UNAVAILABLE, grpc.StatusCode.DEADLINE_EXCEEDED, grpc.StatusCode.CANCELLED):
if e.code() in (
grpc.StatusCode.UNAVAILABLE,
grpc.StatusCode.DEADLINE_EXCEEDED,
grpc.StatusCode.CANCELLED,
):
if attempts <= max_attempts:
self.log.debug(f'Server unavailable, retry [{attempts}/{max_attempts}].')
attempts += 1
Expand Down

0 comments on commit 02d2511

Please sign in to comment.