Skip to content

Commit

Permalink
fix: Log warning if client init timeout is considered high (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed May 10, 2024
1 parent 4018f80 commit 08514fe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ldclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ def __init__(self, config: Config, start_wait: float=5):
self._update_processor = self._make_update_processor(self._config, self._store, update_processor_ready, diagnostic_accumulator)
self._update_processor.start()

if start_wait > 0 and not self._config.offline and not self._config.use_ldd:
log.info("Waiting up to " + str(start_wait) + " seconds for LaunchDarkly client to initialize...")
update_processor_ready.wait(start_wait)
if not self._config.offline and not self._config.use_ldd:
if start_wait > 60:
log.warning("LDClient was instantiated with a timeout greater than 60 seconds. We recommend a timeout of less than 60 seconds.")

if start_wait > 0:
log.info("Waiting up to " + str(start_wait) + " seconds for LaunchDarkly client to initialize...")
update_processor_ready.wait(start_wait)

if self._update_processor.initialized() is True:
log.info("Started LaunchDarkly Client: OK")
Expand Down

0 comments on commit 08514fe

Please sign in to comment.