Beispiel #1
0
 public async Task <IActionResult> Schedule(ScheduleClusterAlgorithmCommand command)
 {
     return(await Policy.Handle <ApiException>(ex => ex.StatusCode == HttpStatusCode.InternalServerError)
            .WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)))
            .ExecuteAsync(async() =>
     {
         var response = await clusterService.Schedule(command);
         return StatusCode((int)response.ResponseMessage.StatusCode);
     }));
 }