Fix start failed deadlock

This commit is contained in:
ChsBuffer
2021-09-21 17:16:40 +08:00
parent d829e347d3
commit dc904c9c0b

View File

@@ -32,7 +32,7 @@ namespace Netch.Controllers
public static async Task StartAsync(Server server, Mode mode)
{
using var _ = await Lock.EnterAsync();
using var releaser = await Lock.EnterAsync();
Log.Information("Start MainController: {Server} {Mode}", $"{server.Type}", $"[{(int)mode.Type}]{mode.Remark}");
@@ -88,6 +88,7 @@ namespace Netch.Controllers
}
catch (Exception e)
{
releaser.Dispose();
await StopAsync();
switch (e)