diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index b024cde939..0abd7cadaf 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -25,7 +25,6 @@ using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Repository; using Tgstation.Server.Host.Components.Watchdog; using Tgstation.Server.Host.Configuration; -using Tgstation.Server.Host.Controllers; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; @@ -47,7 +46,7 @@ namespace Tgstation.Server.Host.Core /// /// The for the /// - readonly Microsoft.Extensions.Configuration.IConfiguration configuration; + readonly IConfiguration configuration; /// /// The for the @@ -61,7 +60,7 @@ namespace Tgstation.Server.Host.Core /// /// The value of /// The value of - public Application(Microsoft.Extensions.Configuration.IConfiguration configuration, Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment) + public Application(IConfiguration configuration, Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment) { this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); this.hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment)); @@ -76,9 +75,7 @@ namespace Tgstation.Server.Host.Core /// Configure dependency injected services /// /// The to configure -#pragma warning disable CA1822 // Mark members as static public void ConfigureServices(IServiceCollection services) -#pragma warning restore CA1822 // Mark members as static { if (services == null) throw new ArgumentNullException(nameof(services)); @@ -266,12 +263,15 @@ namespace Tgstation.Server.Host.Core /// public void Ready(Exception initializationError) { - if (startupTcs.Task.IsCompleted) - throw new InvalidOperationException("Ready has already been called!"); - if (initializationError == null) - startupTcs.SetResult(null); - else - startupTcs.SetException(initializationError); + lock (startupTcs) + { + if (startupTcs.Task.IsCompleted) + throw new InvalidOperationException("Ready has already been called!"); + if (initializationError == null) + startupTcs.SetResult(null); + else + startupTcs.SetException(initializationError); + } } } } \ No newline at end of file