Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Apps.Contentful/Api/ContentfulClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Contentful.Core;
using Contentful.Core.Configuration;
using Contentful.Core.Errors;
using Contentful.Core.Models;
using Newtonsoft.Json;
using Polly;
using Polly.Retry;
Expand All @@ -14,18 +13,18 @@ namespace Apps.Contentful.Api;
public class ContentfulClient : ContentfulManagementClient
{
private const int Limit = 100;
private const int RetryCount = 5;
private const int RetryCount = 7;

private readonly AsyncRetryPolicy _retryPolicy;

public ContentfulClient(IEnumerable<AuthenticationCredentialsProvider> creds, string? environment)
: base(new HttpClient { Timeout=TimeSpan.FromMinutes(5)}, new ContentfulOptions
: base(new HttpClient { Timeout = TimeSpan.FromMinutes(5) }, new ContentfulOptions
{
ManagementApiKey = creds.First(p => p.KeyName == "Authorization").Value,
SpaceId = creds.First(p => p.KeyName == "spaceId").Value,
Environment = environment,
ManagementBaseUrl = creds.First(p => p.KeyName == CredNames.BaseUrl).Value + "/spaces/",
MaxNumberOfRateLimitRetries = RetryCount,
MaxNumberOfRateLimitRetries = RetryCount,
})
{
_retryPolicy = Policy
Expand Down
2 changes: 1 addition & 1 deletion Apps.Contentful/Apps.Contentful.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<Product>Contentful</Product>
<Description>The headless content management system</Description>
<Version>1.8.8</Version>
<Version>1.8.9</Version>
<AssemblyName>Apps.Contentful</AssemblyName>
</PropertyGroup>

Expand Down