Skip to content

Commit

Permalink
Revert "#230 add in TFM's so dependencies can be optimised (#231)"
Browse files Browse the repository at this point in the history
This reverts commit 85d599b.
  • Loading branch information
jodydonetti committed Apr 23, 2024
1 parent 85d599b commit 3be88de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis</PackageId>
<Description>FusionCache backplane for Redis based on the StackExchange.Redis library</Description>
Expand All @@ -24,9 +24,6 @@

<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.7.27" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Serialization.SystemTextJson</PackageId>
<Description>FusionCache serializer based on System.Text.Json</Description>
Expand All @@ -22,7 +22,7 @@
<ProjectReference Include="..\ZiggyCreatures.FusionCache\ZiggyCreatures.FusionCache.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.2" />
</ItemGroup>

Expand Down
18 changes: 11 additions & 7 deletions src/ZiggyCreatures.FusionCache/FusionCacheEntryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,25 +685,22 @@ internal DistributedCacheEntryOptions ToDistributedCacheEntryOptions(FusionCache
// PHYSICAL DURATION
TimeSpan physicalDuration;
TimeSpan durationToUse;
TimeSpan failSafeMaxDurationToUse;
bool incoherentFailSafeMaxDuration = false;

durationToUse = DistributedCacheDuration ?? Duration;

if (IsFailSafeEnabled == false)
{
// FAIL-SAFE DISABLED
physicalDuration = durationToUse;
}
else
{
// FAIL-SAFE ENABLED
var failSafeMaxDurationToUse = DistributedCacheFailSafeMaxDuration ?? FailSafeMaxDuration;
failSafeMaxDurationToUse = DistributedCacheFailSafeMaxDuration ?? FailSafeMaxDuration;
if (failSafeMaxDurationToUse < durationToUse)
{
// INCOHERENT DURATION
incoherentFailSafeMaxDuration = true;
physicalDuration = durationToUse;

if (logger?.IsEnabled(options.IncoherentOptionsNormalizationLogLevel) ?? false)
logger.Log(options.IncoherentOptionsNormalizationLogLevel, "FUSION [N={CacheName} I={CacheInstanceId}] (O={CacheOperationId} K={CacheKey}): DistributedCacheFailSafeMaxDuration/FailSafeMaxDuration {FailSafeMaxDuration} was lower than the DistributedCacheDuration/Duration {Duration} on {Options} {MemoryOptions}. Duration has been used instead.", options.CacheName, options.InstanceId, operationId, key, failSafeMaxDurationToUse.ToLogString(), durationToUse.ToLogString(), this.ToLogString(), res.ToLogString());
}
else
{
Expand All @@ -713,6 +710,13 @@ internal DistributedCacheEntryOptions ToDistributedCacheEntryOptions(FusionCache

res.AbsoluteExpiration = FusionCacheInternalUtils.GetNormalizedAbsoluteExpiration(physicalDuration, this, false);

// INCOHERENT DURATION
if (incoherentFailSafeMaxDuration)
{
if (logger?.IsEnabled(options.IncoherentOptionsNormalizationLogLevel) ?? false)
logger.Log(options.IncoherentOptionsNormalizationLogLevel, "FUSION [N={CacheName} I={CacheInstanceId}] (O={CacheOperationId} K={CacheKey}): DistributedCacheFailSafeMaxDuration/FailSafeMaxDuration {FailSafeMaxDuration} was lower than the DistributedCacheDuration/Duration {Duration} on {Options} {MemoryOptions}. Duration has been used instead.", options.CacheName, options.InstanceId, operationId, key, failSafeMaxDurationToUse.ToLogString(), durationToUse.ToLogString(), this.ToLogString(), res.ToLogString());
}

return res;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache</PackageId>
<Description>FusionCache is an easy to use, fast and robust cache with advanced resiliency features and an optional distributed 2nd level.</Description>
Expand Down Expand Up @@ -37,13 +37,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>

Expand Down

0 comments on commit 3be88de

Please sign in to comment.