Dispose Server on Exit

This commit is contained in:
glax 2024-03-01 11:25:31 +01:00
parent beadca1648
commit e86a49d5f6
2 changed files with 4 additions and 6 deletions

View File

@ -46,13 +46,9 @@ public class API : IDisposable
}); });
t.Start(); t.Start();
} }
catch (OperationCanceledException) catch (Exception e)
{ {
this.logger.LogError(e, e.ToString());
}
catch (HttpListenerException e)
{
this.logger.LogError(e, null);
} }
} }
} }

View File

@ -179,6 +179,7 @@ public class Tracker : IDisposable
public void Dispose() public void Dispose()
{ {
this._logger.LogInformation("Stopping..."); this._logger.LogInformation("Stopping...");
this.api.Dispose();
_running = false; _running = false;
lock (_updateInfoThread) lock (_updateInfoThread)
{ {
@ -195,5 +196,6 @@ public class Tracker : IDisposable
this._logger.LogInformation("Exporting Player-States..."); this._logger.LogInformation("Exporting Player-States...");
foreach (Player player in this._players) foreach (Player player in this._players)
player.ShuttingDownSaveSessions(); player.ShuttingDownSaveSessions();
this._logger.LogInformation("Done. Bye.");
} }
} }