This commit is contained in:
@@ -364,7 +364,7 @@ namespace AyaNovaQBI
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public async static Task<ApiResponse> PutAsync(string route, dynamic d)
|
||||
{
|
||||
Exception FirstException = null;
|
||||
@@ -387,6 +387,28 @@ namespace AyaNovaQBI
|
||||
throw new Exception($"API call failed after {MAX_TRIES.ToString()} attempts", FirstException);
|
||||
}
|
||||
|
||||
public async static Task<ApiResponse> PutAsync(string route, string s=null)
|
||||
{
|
||||
Exception FirstException = null;
|
||||
|
||||
for (int x = 0; x < MAX_TRIES; x++)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await TryPutAsync(route, s);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (FirstException == null)
|
||||
FirstException = ex;
|
||||
}
|
||||
await Task.Delay(API_RETRY_DELAY);
|
||||
}
|
||||
|
||||
//no luck re-throw the exception
|
||||
throw new Exception($"API call failed after {MAX_TRIES.ToString()} attempts", FirstException);
|
||||
}
|
||||
|
||||
public async static Task<ApiResponse> PutAsync(string route)
|
||||
{
|
||||
Exception FirstException = null;
|
||||
|
||||
Reference in New Issue
Block a user