From 0dab8f2ca195d04443225914cbc41892211396a3 Mon Sep 17 00:00:00 2001 From: GZTime Date: Mon, 13 May 2024 21:35:55 +0800 Subject: [PATCH] fix(config): cache won't flush when config add --- src/GZCTF/Services/ConfigService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GZCTF/Services/ConfigService.cs b/src/GZCTF/Services/ConfigService.cs index acfdd4e19..a8e5b518a 100644 --- a/src/GZCTF/Services/ConfigService.cs +++ b/src/GZCTF/Services/ConfigService.cs @@ -48,11 +48,15 @@ public async Task SaveConfigSet(HashSet configs, CancellationToken token } else { + if (conf.CacheKeys is not null) + cacheKeys.UnionWith(conf.CacheKeys); + + await context.Configs.AddAsync(conf, token); + logger.SystemLog( Program.StaticLocalizer[nameof(Resources.Program.Config_GlobalConfigAdded), conf.ConfigKey, conf.Value ?? "null"], TaskStatus.Success, LogLevel.Debug); - await context.Configs.AddAsync(conf, token); } }