Implemented statistics. Refactored storage abstractions. Added config options for docker and local storage. Added server service and server updating.

This commit is contained in:
2026-03-02 15:51:05 +00:00
parent 52dbd13fb5
commit 2d1b48b0d4
27 changed files with 493 additions and 147 deletions

View File

@@ -0,0 +1,34 @@
namespace MoonlightServers.Daemon.ServerSystem;
public partial class Server
{
public async Task UpdateAsync()
{
await Lock.WaitAsync();
try
{
if (State is ServerState.Online or ServerState.Starting or ServerState.Stopping)
{
Logger.LogTrace("Fetching latest runtime configuration");
RuntimeConfiguration = await ConfigurationService.GetRuntimeConfigurationAsync(Uuid);
if (RuntimeEnvironment != null)
{
Logger.LogTrace("Updating runtime environment");
await RuntimeEnvironmentService.UpdateAsync(RuntimeEnvironment, RuntimeConfiguration);
}
if (RuntimeStorage != null)
{
Logger.LogTrace("Updating runtime storage");
await RuntimeStorageService.UpdateAsync(RuntimeStorage, RuntimeConfiguration);
}
}
}
finally
{
Lock.Release();
}
}
}