Skip to content

Commit

Permalink
fixup: recreate channel on any grpc err
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert committed Nov 25, 2024
1 parent 4ba24f0 commit f91dd5c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def sync_flags(self) -> None:
except grpc.RpcError as e:
logger.error(f"SyncFlags stream error, {e.code()=} {e.details()=}")
# re-create the stub if there's a connection issue - otherwise reconnect does not work as expected
if e.code() == grpc.StatusCode.UNAVAILABLE:
self.stub, self.channel = self.create_stub()
self.stub, self.channel = self.create_stub()
except json.JSONDecodeError:
logger.exception(
f"Could not parse JSON flag data from SyncFlags endpoint: {flag_str=}"
Expand Down

0 comments on commit f91dd5c

Please sign in to comment.