Skip to content

Commit 08514fe

Browse files
authored
fix: Log warning if client init timeout is considered high (#295)
1 parent 4018f80 commit 08514fe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ldclient/client.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,13 @@ def __init__(self, config: Config, start_wait: float=5):
227227
self._update_processor = self._make_update_processor(self._config, self._store, update_processor_ready, diagnostic_accumulator)
228228
self._update_processor.start()
229229

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

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

0 commit comments

Comments
 (0)