From 3c82fe9b4ed1180af3e3a35425aeb4ee01a26600 Mon Sep 17 00:00:00 2001 From: devhl Date: Thu, 4 Apr 2024 21:48:53 -0400 Subject: [PATCH] possible bug fix --- src/CocApi.Cache/CocApi.Cache.csproj | 2 +- src/CocApi.Cache/Services/ClanService.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/CocApi.Cache/CocApi.Cache.csproj b/src/CocApi.Cache/CocApi.Cache.csproj index 768debb..f1dd093 100644 --- a/src/CocApi.Cache/CocApi.Cache.csproj +++ b/src/CocApi.Cache/CocApi.Cache.csproj @@ -6,7 +6,7 @@ devhl Caches response from the Clash of Clans API. - 2.11.6-debug.5 + 2.11.6-debug.6 2.0.0.0 2.0.0.0 true diff --git a/src/CocApi.Cache/Services/ClanService.cs b/src/CocApi.Cache/Services/ClanService.cs index 7b0e843..666cc0e 100644 --- a/src/CocApi.Cache/Services/ClanService.cs +++ b/src/CocApi.Cache/Services/ClanService.cs @@ -236,9 +236,8 @@ private void ExtendWarTTLWhileInCwl(CachedClan cachedClan) cachedClan.CurrentWar.Content?.State == Rest.Models.WarState.Preparation || cachedClan.Group.Content == null || cachedClan.Group.Content.State == Rest.Models.GroupState.Ended || - cachedClan.Group.Content.Season.Month < DateTime.UtcNow.Month || - (cachedClan.Group.KeepUntil.HasValue && cachedClan.Group.KeepUntil.Value.Month > DateTime.UtcNow.Month) || - cachedClan.Group.DownloadedAt < DateTime.UtcNow.AddDays(-7)) + (cachedClan.Group.Content.Season.Month < DateTime.UtcNow.Month || cachedClan.Group.Content.Season.Year < DateTime.UtcNow.Year) || + (cachedClan.Group.KeepUntil.HasValue && cachedClan.Group.KeepUntil.Value.Month > DateTime.UtcNow.Month)) return; // keep currentwar around an arbitrary amount of time since we are in cwl