This repository was archived by the owner on May 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ public sealed class LdClient : IDisposable, ILdClient
4343 private readonly Logger _evalLog ;
4444 private readonly IHookExecutor _hookExecutor ;
4545
46+ private readonly TimeSpan ExcessiveInitWaitTime = TimeSpan . FromSeconds ( 60 ) ;
47+ private const String InitWaitTimeInfo = "Waiting up to {0} milliseconds for LaunchDarkly client to start." ;
48+ private const String ExcessiveInitWaitTimeWarning =
49+ "LaunchDarkly client created with StartWaitTime of {0} milliseconds. We recommend a timeout of less than {1} milliseconds." ;
50+ private const String DidNotInitializeTimelyWarning = "Client did not initialize within {0} milliseconds." ;
51+
4652 #endregion
4753
4854 #region Public properties
@@ -205,8 +211,11 @@ public LdClient(Configuration config)
205211
206212 if ( ! ( _dataSource is ComponentsImpl . NullDataSource ) )
207213 {
208- _log . Info ( "Waiting up to {0} milliseconds for LaunchDarkly client to start..." ,
209- _configuration . StartWaitTime . TotalMilliseconds ) ;
214+ _log . Info ( InitWaitTimeInfo , _configuration . StartWaitTime . TotalMilliseconds ) ;
215+ if ( _configuration . StartWaitTime >= ExcessiveInitWaitTime )
216+ {
217+ _log . Warn ( ExcessiveInitWaitTimeWarning , _configuration . StartWaitTime . TotalMilliseconds , ExcessiveInitWaitTime . TotalMilliseconds ) ;
218+ }
210219 }
211220
212221 try
You can’t perform that action at this time.
0 commit comments