Skip to content

Commit

Permalink
Users/ismayilov ismayil/add delay when message null (#4456)
Browse files Browse the repository at this point in the history
* Add delay when ADO returns null message for any reason
  • Loading branch information
ismayilov-ismayil authored Oct 10, 2023
1 parent 82cf476 commit 81514c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Agent.Listener/MessageListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ public async Task<TaskAgentMessage> GetNextMessageAsync(CancellationToken token)
Trace.Verbose($"No message retrieved from session '{_session.SessionId}'.");
}

_getNextMessageRetryInterval = BackoffTimerHelper.GetRandomBackoff(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(15), _getNextMessageRetryInterval);
Trace.Info("Sleeping for {0} seconds before retrying.", _getNextMessageRetryInterval.TotalSeconds);
await HostContext.Delay(_getNextMessageRetryInterval, token);
continue;
}

Expand Down

0 comments on commit 81514c8

Please sign in to comment.