diff --git a/src/Tgstation.Server.Host/Core/JobManager.cs b/src/Tgstation.Server.Host/Core/JobManager.cs index bb0e37939a..fc08c985b8 100644 --- a/src/Tgstation.Server.Host/Core/JobManager.cs +++ b/src/Tgstation.Server.Host/Core/JobManager.cs @@ -158,7 +158,7 @@ namespace Tgstation.Server.Host.Core var databaseContext = scope.ServiceProvider.GetRequiredService(); //mark all jobs as cancelled - var badJobs = await databaseContext.Jobs.Where(y => !y.Cancelled.Value && !y.StoppedAt.HasValue).Select(y => y.Id).ToListAsync(cancellationToken).ConfigureAwait(false); + var badJobs = await databaseContext.Jobs.Where(y => !y.StoppedAt.HasValue).Select(y => y.Id).ToListAsync(cancellationToken).ConfigureAwait(false); if (badJobs.Count > 0) { logger.LogTrace("Cleaning {0} unfinished jobs...", badJobs.Count); @@ -167,6 +167,7 @@ namespace Tgstation.Server.Host.Core var job = new Job { Id = I }; databaseContext.Jobs.Attach(job); job.Cancelled = true; + job.StoppedAt = DateTimeOffset.Now; } await databaseContext.Save(cancellationToken).ConfigureAwait(false); }