This commit is contained in:
2022-07-01 19:11:24 +00:00
parent 7365f74250
commit f61fa815b8

View File

@@ -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;