We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 623c750 commit 72e0e7bCopy full SHA for 72e0e7b
src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs
@@ -393,9 +393,10 @@ public static IExchangeAPI GetExchangeAPI(Type type)
393
{
394
api = (Activator.CreateInstance(foundType, true)as ExchangeAPI) !;
395
Exception? ex = null;
396
+ const int retryCount = 3;
397
- // try up to 3 times to init
398
- for (int i = 0; i < 3; i++)
+ // try up to n times to init
399
+ for (int i = 1; i <= retryCount; i++)
400
401
try
402
@@ -406,7 +407,10 @@ public static IExchangeAPI GetExchangeAPI(Type type)
406
407
catch (Exception _ex)
408
409
ex = _ex;
- Thread.Sleep(5000);
410
+ if (i != retryCount)
411
+ {
412
+ Thread.Sleep(5000);
413
+ }
414
}
415
416
0 commit comments