diff --git a/Duplicati/Agent/Program.cs b/Duplicati/Agent/Program.cs index 53df9f5c4..ff1513016 100644 --- a/Duplicati/Agent/Program.cs +++ b/Duplicati/Agent/Program.cs @@ -320,13 +320,13 @@ public static class Program } private static Task> OnConnect(Dictionary metadata) - => FIXMEGlobal.Provider.GetRequiredService().OnConnect(metadata); + => Server.Program.DuplicatiWebserver.Provider.GetRequiredService().OnConnect(metadata); private static Task OnControl(KeepRemoteConnection.ControlMessage message) - => FIXMEGlobal.Provider.GetRequiredService().OnControl(message); + => Server.Program.DuplicatiWebserver.Provider.GetRequiredService().OnControl(message); private static Task OnMessage(KeepRemoteConnection.CommandMessage message) - => FIXMEGlobal.Provider.GetRequiredService().OnMessage(message); + => Server.Program.DuplicatiWebserver.Provider.GetRequiredService().OnMessage(message); private static Task ReKey(ClaimedClientData keydata, CommandLineArguments agentConfig) diff --git a/Duplicati/Library/RestAPI/FIXMEGlobal.cs b/Duplicati/Library/RestAPI/FIXMEGlobal.cs index d4e6009d2..02a401878 100644 --- a/Duplicati/Library/RestAPI/FIXMEGlobal.cs +++ b/Duplicati/Library/RestAPI/FIXMEGlobal.cs @@ -36,8 +36,6 @@ namespace Duplicati.Library.RestAPI /// public const string PASSWORD_PLACEHOLDER = "**********"; - public static IServiceProvider Provider { get; set; } - public static Action StartOrStopUsageReporter; /// diff --git a/Duplicati/Server/Program.cs b/Duplicati/Server/Program.cs index 69aec6ccd..7a7287dcb 100644 --- a/Duplicati/Server/Program.cs +++ b/Duplicati/Server/Program.cs @@ -413,7 +413,6 @@ namespace Duplicati.Server return server; }).ConfigureAwait(false); - FIXMEGlobal.Provider = server.Provider; ServerPortChanged |= server.Port != DataConnection.ApplicationSettings.LastWebserverPort; DataConnection.ApplicationSettings.LastWebserverPort = server.Port; diff --git a/Duplicati/UnitTest/ImportExportTests.cs b/Duplicati/UnitTest/ImportExportTests.cs index 50f6e49f4..40f99644d 100644 --- a/Duplicati/UnitTest/ImportExportTests.cs +++ b/Duplicati/UnitTest/ImportExportTests.cs @@ -131,10 +131,6 @@ namespace Duplicati.UnitTest var advancedOptions = new Dictionary { { "server-datafolder", this.serverDatafolder } }; // Mock the setup enough to get the import/export working - var serviceCollection = new ServiceCollection(); - serviceCollection.AddSingleton(); - serviceCollection.AddSingleton(new EventPollNotify()); - FIXMEGlobal.Provider = new DefaultServiceProviderFactory().CreateServiceProvider(serviceCollection); FIXMEGlobal.DataFolder = this.serverDatafolder; var dbpath = Path.Combine(this.serverDatafolder, Library.AutoUpdater.DataFolderManager.SERVER_DATABASE_FILENAME);