Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion providers/openfeature-provider-flagd/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ classifiers = [
keywords = []
dependencies = [
"openfeature-sdk>=0.8.2",
"grpcio>=1.68.1",
"grpcio>=1.76.0",
"protobuf>=6.30.0,<7.0.0",
"mmh3>=5.0.0,<6.0.0",
"panzi-json-logic>=1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def __init__(
self.thread: typing.Optional[threading.Thread] = None
self.timer: typing.Optional[threading.Timer] = None

self.start_time = time.time()

def _generate_channel(self, config: Config) -> grpc.Channel:
target = f"{config.host}:{config.port}"
# Create the channel with the service config
Expand Down Expand Up @@ -163,8 +161,8 @@ def connect(self) -> None:
)
self.monitor_thread.start()
## block until ready or deadline reached
timeout = self.deadline + time.time()
while not self.connected and time.time() < timeout:
timeout = self.deadline + time.monotonic()
while not self.connected and time.monotonic() < timeout:
time.sleep(0.05)
logger.debug("Finished blocking gRPC state initialization")

Expand Down Expand Up @@ -201,7 +199,6 @@ def _state_change_callback(self, new_state: ChannelConnectivity) -> None:
message="gRPC sync disconnected, reconnecting",
)
)
self.start_time = time.time()
# adding a timer, so we can emit the error event after time
self.timer = threading.Timer(self.retry_grace_period, self.emit_error)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ def __init__(
self.thread: typing.Optional[threading.Thread] = None
self.timer: typing.Optional[threading.Timer] = None

self.start_time = time.time()

def _generate_channel(self, config: Config) -> grpc.Channel:
target = f"{config.host}:{config.port}"
# Create the channel with the service config
Expand Down Expand Up @@ -144,8 +142,8 @@ def connect(self) -> None:
)
self.monitor_thread.start()
## block until ready or deadline reached
timeout = self.deadline + time.time()
while not self.connected and time.time() < timeout:
timeout = self.deadline + time.monotonic()
while not self.connected and time.monotonic() < timeout:
time.sleep(0.05)
logger.debug("Finished blocking gRPC state initialization")

Expand Down Expand Up @@ -182,7 +180,6 @@ def _state_change_callback(self, new_state: grpc.ChannelConnectivity) -> None:
message="gRPC sync disconnected, reconnecting",
)
)
self.start_time = time.time()
# adding a timer, so we can emit the error event after time
self.timer = threading.Timer(self.retry_grace_period, self.emit_error)

Expand Down