1.1.3 -> 1.1.4 第83次更新

This commit is contained in:
Space Time 2024-12-20 00:50:13 +08:00
parent 6a7b65fe99
commit dcef7be238

View File

@ -9,11 +9,11 @@ namespace Sheas_Cealer.Utils
{ {
internal static class NginxCleaner internal static class NginxCleaner
{ {
private static readonly object IsCleaningLock = new(); private static readonly SemaphoreSlim IsCleaningSemaphore = new(1);
internal static async Task Clean() internal static async Task Clean()
{ {
if (!Monitor.TryEnter(IsCleaningLock)) if (!await IsCleaningSemaphore.WaitAsync(0))
return; return;
try try
@ -40,7 +40,7 @@ namespace Sheas_Cealer.Utils
certStore.Close(); certStore.Close();
} }
finally { Monitor.Exit(IsCleaningLock); } finally { IsCleaningSemaphore.Release(); }
} }
} }
} }