79306038

Date: 2024-12-24 16:22:05
Score: 0.5
Natty:
Report link

readonly AsyncRetryPolicy _retryPolicy;

_retryPolicy = Policy .Handle<MongoDB.Driver.MongoInternalException>() .WaitAndRetryAsync(3, attempt => TimeSpan.FromSeconds(_retryInterval[attempt - 1]));

`await _retryPolicy.ExecuteAsync(async () => { var updateResult = await repository.UpdateAsync(param1, param2, cancellationToken); totalUpdatedRows += updateResult?.ModifiedCount ?? 0;

 if (updateResult == null || updateResult.MatchedCount == 0 || totalUpdatedRows != alertIntegrationsCount)
 {
     throw new MongoDB.Driver.MongoInternalException("No Record Found");
 }

}); `

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Dev-lop-er