mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Make the first log message the server version
This commit is contained in:
@@ -28,6 +28,11 @@ namespace Tgstation.Server.Host.Components
|
||||
/// <inheritdoc />
|
||||
public Task Ready => readyTcs.Task;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Lazy{T}"/> <see cref="IRestartRegistration"/> for the <see cref="InstanceManager"/>;
|
||||
/// </summary>
|
||||
readonly Lazy<IRestartRegistration> lazyRestartRegistration;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IInstanceFactory"/> for the <see cref="InstanceManager"/>
|
||||
/// </summary>
|
||||
@@ -155,7 +160,7 @@ namespace Tgstation.Server.Host.Components
|
||||
generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions));
|
||||
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
|
||||
serverControl.RegisterForRestart(this);
|
||||
lazyRestartRegistration = new Lazy<IRestartRegistration>(() => serverControl.RegisterForRestart(this));
|
||||
|
||||
instances = new Dictionary<long, IInstance>();
|
||||
bridgeHandlers = new Dictionary<string, IBridgeHandler>();
|
||||
@@ -174,6 +179,10 @@ namespace Tgstation.Server.Host.Components
|
||||
|
||||
foreach (var I in instances)
|
||||
I.Value.Dispose();
|
||||
|
||||
lazyRestartRegistration.Value.Dispose();
|
||||
|
||||
logger.LogInformation("Server shutdown");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -287,6 +296,10 @@ namespace Tgstation.Server.Host.Components
|
||||
{
|
||||
logger.LogInformation(assemblyInformationProvider.VersionString);
|
||||
|
||||
// we do this here because making the restart registration triggers a trace log message
|
||||
// The above log message should be the first one one startup
|
||||
var _ = lazyRestartRegistration.Value;
|
||||
|
||||
try
|
||||
{
|
||||
generalConfiguration.CheckCompatibility(logger);
|
||||
|
||||
Reference in New Issue
Block a user