Skip to content

Commit

Permalink
fix(config): flush index cache at launch
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed May 13, 2024
1 parent ca06c9a commit 6894dbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/GZCTF/Utils/PrelaunchHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GZCTF.Models.Internal;
using GZCTF.Services.Cache;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Distributed;
Expand Down Expand Up @@ -70,6 +71,9 @@ await context.Posts.AddAsync(new()

if (!cache.CacheCheck())
Program.ExitWithFatalMessage(Program.StaticLocalizer[nameof(Resources.Program.Init_InvalidCacheConfig)]);

await cache.RemoveAsync(CacheKey.Index);
await cache.RemoveAsync(CacheKey.Favicon);
}

static bool CacheCheck(this IDistributedCache cache)
Expand Down

0 comments on commit 6894dbd

Please sign in to comment.