Skip to content

Commit

Permalink
feat: don't cache legacy GAWR-5195
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Sep 12, 2023
1 parent 3f70a78 commit 307251c
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace PostalRegistry.Projections.LastChangedList
public class LastChangedListProjections : LastChangedListConnectedProjection
{

private static readonly AcceptType[] SupportedAcceptTypes = { AcceptType.Json, AcceptType.Xml, AcceptType.JsonLd };
private static readonly AcceptType[] SupportedAcceptTypes = { AcceptType.JsonLd };

public LastChangedListProjections()
: base(SupportedAcceptTypes)
Expand Down Expand Up @@ -54,8 +54,6 @@ protected override string BuildCacheKey(AcceptType acceptType, string identifier
var shortenedAcceptType = acceptType.ToString().ToLowerInvariant();
return acceptType switch
{
AcceptType.Json => $"legacy/postalinfo:{{0}}.{shortenedAcceptType}",
AcceptType.Xml => $"legacy/postalinfo:{{0}}.{shortenedAcceptType}",
AcceptType.JsonLd => $"oslo/postalinfo:{{0}}.{shortenedAcceptType}",
_ => throw new NotImplementedException($"Cannot build CacheKey for type {typeof(AcceptType)}")
};
Expand All @@ -65,8 +63,6 @@ protected override string BuildUri(AcceptType acceptType, string identifier)
{
return acceptType switch
{
AcceptType.Json => "/v1/postcodes/{0}",
AcceptType.Xml => "/v1/postcodes/{0}",
AcceptType.JsonLd => "/v2/postcodes/{0}",
_ => throw new NotImplementedException($"Cannot build Uri for type {typeof(AcceptType)}")
};
Expand Down

0 comments on commit 307251c

Please sign in to comment.