mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 08:00:19 +01:00
Reading the CompileJob from DM controller is redundant with DD controller
This commit is contained in:
@@ -7,12 +7,6 @@ namespace Tgstation.Server.Api.Models
|
||||
/// </summary>
|
||||
public sealed class DreamMaker : DreamMakerSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// The last <see cref="CompileJob"/> ran
|
||||
/// </summary>
|
||||
[Permissions(DenyWrite = true)]
|
||||
public CompileJob LastJob { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="CompilerStatus"/> of the compiler
|
||||
/// </summary>
|
||||
|
||||
@@ -49,12 +49,10 @@ namespace Tgstation.Server.Host.Controllers
|
||||
public override async Task<IActionResult> Read(CancellationToken cancellationToken)
|
||||
{
|
||||
var instance = instanceManager.GetInstance(Instance);
|
||||
var projectNameTask = DatabaseContext.DreamMakerSettings.Where(x => x.InstanceId == Instance.Id).Select(x => x.ProjectName).FirstOrDefaultAsync(cancellationToken);
|
||||
var job = await DatabaseContext.CompileJobs.OrderByDescending(x => x.Job.StartedAt).Include(x => x.Job).FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false);
|
||||
var projectName = await DatabaseContext.DreamMakerSettings.Where(x => x.InstanceId == Instance.Id).Select(x => x.ProjectName).FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false);
|
||||
return Json(new Api.Models.DreamMaker
|
||||
{
|
||||
LastJob = job?.ToApi(),
|
||||
ProjectName = await projectNameTask.ConfigureAwait(false),
|
||||
ProjectName = projectName,
|
||||
Status = instance.DreamMaker.Status
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user