Skip to content

Commit 848841b

Browse files
feature(#12): this commit introduces configuration for idempotency services in memory
1 parent fdb7509 commit 848841b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Boundaries/Comanda.Orchestrator/Source/Comanda.Orchestrator.WebApi/Extensions/WebInfrastructureExtension.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,13 @@ public static void AddWebComposition(this IServiceCollection services)
2727
options.Realm = settings.Federation.Realm;
2828
options.ClientSecret = settings.Federation.ClientSecret;
2929
});
30+
31+
services.AddIdempotency()
32+
.WithInMemoryCache(options =>
33+
{
34+
options.DefaultCacheExpiration = TimeSpan.FromMinutes(1);
35+
options.DefaultHeaderName = Headers.Idempotency;
36+
options.ThrowOnMissingKey = false;
37+
});
3038
}
3139
}

0 commit comments

Comments
 (0)