From 2cc8412b50bac4cb7811b40680b3ea8770fca250 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 22 Aug 2018 10:01:20 -0400 Subject: [PATCH] Don't show "on reboot" deploy message unless the ting is roonin --- .../Components/Compiler/DreamMaker.cs | 9 +++++++-- src/Tgstation.Server.Host/Components/InstanceFactory.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Compiler/DreamMaker.cs b/src/Tgstation.Server.Host/Components/Compiler/DreamMaker.cs index 514b574631..e3d3688c0d 100644 --- a/src/Tgstation.Server.Host/Components/Compiler/DreamMaker.cs +++ b/src/Tgstation.Server.Host/Components/Compiler/DreamMaker.cs @@ -77,6 +77,10 @@ namespace Tgstation.Server.Host.Components.Compiler /// readonly IProcessExecutor processExecutor; /// + /// The for + /// + readonly IWatchdog watchdog; + /// /// The for /// readonly ILogger logger; @@ -93,8 +97,9 @@ namespace Tgstation.Server.Host.Components.Compiler /// The value of /// The value of /// The value of + /// The value of /// The value of - public DreamMaker(IByondManager byond, IIOManager ioManager, StaticFiles.IConfiguration configuration, ISessionControllerFactory sessionControllerFactory, ICompileJobConsumer compileJobConsumer, IApplication application, IEventConsumer eventConsumer, IChat chat, IProcessExecutor processExecutor, ILogger logger) + public DreamMaker(IByondManager byond, IIOManager ioManager, StaticFiles.IConfiguration configuration, ISessionControllerFactory sessionControllerFactory, ICompileJobConsumer compileJobConsumer, IApplication application, IEventConsumer eventConsumer, IChat chat, IProcessExecutor processExecutor, IWatchdog watchdog, ILogger logger) { this.byond = byond; this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager)); @@ -386,7 +391,7 @@ namespace Tgstation.Server.Host.Components.Compiler await Task.WhenAll(symATask, symBTask).ConfigureAwait(false); - await chat.SendUpdateMessage("Deployment complete! Changes will be applied on next server reboot.", cancellationToken).ConfigureAwait(false); + await chat.SendUpdateMessage(String.Format(CultureInfo.InvariantCulture, "Deployment complete!{0}", watchdog.Running ? " Changes will be applied on next server reboot." : String.Empty), cancellationToken).ConfigureAwait(false); logger.LogDebug("Compile complete!"); return job; diff --git a/src/Tgstation.Server.Host/Components/InstanceFactory.cs b/src/Tgstation.Server.Host/Components/InstanceFactory.cs index 3d136dd405..2098055031 100644 --- a/src/Tgstation.Server.Host/Components/InstanceFactory.cs +++ b/src/Tgstation.Server.Host/Components/InstanceFactory.cs @@ -152,7 +152,7 @@ namespace Tgstation.Server.Host.Components commandFactory.SetWatchdog(watchdog); try { - var dreamMaker = new DreamMaker(byond, gameIoManager, configuration, sessionControllerFactory, dmbFactory, application, eventConsumer, chat, processExecutor, loggerFactory.CreateLogger()); + var dreamMaker = new DreamMaker(byond, gameIoManager, configuration, sessionControllerFactory, dmbFactory, application, eventConsumer, chat, processExecutor, watchdog, loggerFactory.CreateLogger()); return new Instance(metadata.CloneMetadata(), repoManager, byond, dreamMaker, watchdog, chat, configuration, dmbFactory, databaseContextFactory, dmbFactory, loggerFactory.CreateLogger()); }