I have the following code which calls contentful cms. This is the code called by my webhook. So now since I'm new to this retry mechanism in C#.
How to achieve retry when the rate limiting error occurs from contentful? Contentful cms has tech limitation of 10 calls per second. If any calls has been failed then we need to retry them with the retry policy.
Any idea on how to start it.
public async Task HandleRedirectAsync(string slug, string previousSlug, string contentTypeId, string entryId){ var endpoint = "entries"; if (!string.IsNullOrEmpty(slug)) { var isPreviousSlugNotEmpty = !String.IsNullOrEmpty(previousSlug); var isSlugAndPreviousSlugSame = slug == previousSlug; if (isPreviousSlugNotEmpty && isSlugAndPreviousSlugSame) { return; } //Delete API call to cms await DeleteRedirectLoopsAsync(slug, contentTypeId, endpoint); if (isPreviousSlugNotEmpty && !isSlugAndPreviousSlugSame) { await CreateAndPublishRedirectEntryAsync(entryId, previousSlug, slug); } await UpdateEntryAsync(contentTypeId, entryId); }}