From d7a1f8f0d0239aeee0b2d4902283910d82052ca0 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 18 May 2020 15:45:57 -0400 Subject: [PATCH] Fix GET /DreamDaemon possible not returning completed jobs --- .../Components/Deployment/DmbFactory.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Tgstation.Server.Host/Components/Deployment/DmbFactory.cs b/src/Tgstation.Server.Host/Components/Deployment/DmbFactory.cs index cea2a3f7c7..9c6b2190de 100644 --- a/src/Tgstation.Server.Host/Components/Deployment/DmbFactory.cs +++ b/src/Tgstation.Server.Host/Components/Deployment/DmbFactory.cs @@ -202,6 +202,15 @@ namespace Tgstation.Server.Host.Components.Deployment .Include(x => x.RevisionInformation).ThenInclude(x => x.ActiveTestMerges).ThenInclude(x => x.TestMerge).ThenInclude(x => x.MergedBy) .FirstAsync(cancellationToken).ConfigureAwait(false)).ConfigureAwait(false); // can't wait to see that query + if (!compileJob.Job.StoppedAt.HasValue) + { + // This happens if we're told to load the compile job that is currently finished up + // It can constitute an API violation if it's returned by the DreamDaemonController so just set it here + // Bit of a hack, but it should work out to be the same value + logger.LogTrace("Setting missing StoppedAt for CompileJob job..."); + compileJob.Job.StoppedAt = DateTimeOffset.Now; + } + logger.LogTrace("Loading compile job {0}...", compileJob.Id); var providerSubmitted = false; var newProvider = new DmbProvider(compileJob, ioManager, () =>