Added node server sync and delete sync. Cleaned up codebase and extracted calls to apis to services
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Docker.DotNet;
|
||||
using MoonlightServers.Daemon.Enums;
|
||||
using MoonlightServers.Daemon.Extensions;
|
||||
using MoonlightServers.Daemon.Services;
|
||||
|
||||
namespace MoonlightServers.Daemon.Abstractions;
|
||||
|
||||
@@ -11,6 +13,17 @@ public partial class Server
|
||||
{
|
||||
try
|
||||
{
|
||||
await LogToConsole("Fetching configuration");
|
||||
|
||||
var remoteService = ServiceProvider.GetRequiredService<RemoteService>();
|
||||
var serverData = await remoteService.GetServer(Configuration.Id);
|
||||
|
||||
// We are updating the server config here
|
||||
// as changes to variables and other settings wouldn't sync otherwise
|
||||
// because they won't trigger a sync
|
||||
var serverConfiguration = serverData.ToServerConfiguration();
|
||||
UpdateConfiguration(serverConfiguration);
|
||||
|
||||
await ReCreate();
|
||||
|
||||
await LogToConsole("Starting container");
|
||||
|
||||
Reference in New Issue
Block a user