Esempio n. 1
0
 private static void CompleteSuccessfulTask(RevaleeTask task)
 {
     Supervisor.State.CompleteTask(task);
     Supervisor.LogEvent(string.Format("Successful callback to {0}. [{1}]", task.CallbackUrl.OriginalString, task.CallbackId), TraceEventType.Verbose);
     Supervisor.Telemetry.RecordWaitTime(CalculateWaitTime(DateTime.UtcNow, task));
     Supervisor.Telemetry.RecordSuccessfulCallback();
     RetryHeuristics.OnSuccess(task.CallbackUrl);
 }
Esempio n. 2
0
        private static void RetryTask(RevaleeTask task)
        {
            // Update the persisted attempt counts
            Supervisor.State.UpdateTask(task);

            // Reenlist task to be retried later
            TimeSpan retryDelay          = RetryHeuristics.OnRetryableFailure(task.CallbackUrl);
            DateTime delayedCallbackTime = DateTime.UtcNow.Add(retryDelay);

            Supervisor.State.ReenlistTask(task, delayedCallbackTime);
            Supervisor.LogEvent(string.Format("Retrying callback to {0} after waiting {1}. [{2}]", task.CallbackUrl.OriginalString, retryDelay, task.CallbackId), TraceEventType.Information);
        }