async void OnSendMessageFailure(IThrottleQueue <IMessage> queue, IMessage message, ILogger logger, Exception exception)
        {
            if (message.SendAttempts <= 5)
            {
                logger?.LogWarning($"OnSendMessageFailure. Failed to send message {message.Text}. Tried {message.SendAttempts} times (exception: {exception})");
                await Task.Delay(1000 *message.SendAttempts);

                queue.Enqueue(message);
                return;
            }
            logger?.LogError($"OnSendMessageFailure. Gave up trying to send message {message.Text} (exception: {exception})");
        }
Exemple #2
0
 public ValuesController(IMetricsContainer metrics, IThrottleQueue tq, IApiCaller api)
 {
     this._metrics = metrics;
     this._tq      = tq;
     this._api     = api;
 }
Exemple #3
0
 public ValuesController(IMetricsContainer metrics, IThrottleQueue tq)
 {
     this._metrics = metrics;
     this._tq      = tq;
 }