Shutdown ("Exit", "Stop") now exist

This commit is contained in:
2026-04-13 16:27:12 -04:00
parent 085507519a
commit 627d67be39
3 changed files with 42 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ using RelayServer.Services.Core;
using RelayServer.Services.Data;
using RelayServer.Services.Rtc;
using RelayShared.Rtc;
using RelayShared.Services;
using WebSocketSharp.Server;
var surrealService = new SurrealService();
@@ -41,7 +42,8 @@ Console.WriteLine("WebSocket server started");
await app.StartAsync();
Console.WriteLine("HTTP API started");
Console.ReadKey(true); // TODO: Make program stop be a console command
ConsoleCommandService.Start();
await Task.Delay(Timeout.Infinite, ConsoleCommandService.ShutdownTokenSource.Token);
wssv.Stop();
await app.StopAsync();