diff --git a/build/WebpanelVersion.props b/build/WebpanelVersion.props index 6ce3ba7841..92d76e353b 100644 --- a/build/WebpanelVersion.props +++ b/build/WebpanelVersion.props @@ -1,6 +1,6 @@ - 5.7.1 + 5.8.0 diff --git a/src/Tgstation.Server.Host/Controllers/InstanceController.cs b/src/Tgstation.Server.Host/Controllers/InstanceController.cs index c17b5a455d..cca228300c 100644 --- a/src/Tgstation.Server.Host/Controllers/InstanceController.cs +++ b/src/Tgstation.Server.Host/Controllers/InstanceController.cs @@ -860,6 +860,8 @@ namespace Tgstation.Server.Host.Controllers IncludingSeconds = true, }) == null)) return BadRequest(new ErrorMessageResponse(ErrorCode.ModelValidationFailure)); + + instance.AutoUpdateInterval = 0; } else instance.AutoUpdateCron = String.Empty; diff --git a/src/Tgstation.Server.Host/Models/Instance.cs b/src/Tgstation.Server.Host/Models/Instance.cs index a96470e9fa..35434d81e1 100644 --- a/src/Tgstation.Server.Host/Models/Instance.cs +++ b/src/Tgstation.Server.Host/Models/Instance.cs @@ -69,6 +69,7 @@ namespace Tgstation.Server.Host.Models public InstanceResponse ToApi() => new() { AutoUpdateInterval = AutoUpdateInterval, + AutoUpdateCron = AutoUpdateCron, ConfigurationType = ConfigurationType, Id = Id, Name = Name, diff --git a/tests/Tgstation.Server.Tests/Live/InstanceManagerTest.cs b/tests/Tgstation.Server.Tests/Live/InstanceManagerTest.cs index 21442827b6..a346b8b0ed 100644 --- a/tests/Tgstation.Server.Tests/Live/InstanceManagerTest.cs +++ b/tests/Tgstation.Server.Tests/Live/InstanceManagerTest.cs @@ -179,19 +179,25 @@ namespace Tgstation.Server.Tests.Live }, cancellationToken), ErrorCode.ModelValidationFailure); // regression check - await instanceManagerClient.Update(new InstanceUpdateRequest + var updated = await instanceManagerClient.Update(new InstanceUpdateRequest { Id = firstTest.Id, AutoUpdateInterval = 9999, }, cancellationToken); + Assert.AreEqual(String.Empty, updated.AutoUpdateCron); + Assert.AreEqual(9999U, updated.AutoUpdateInterval); + // check regular 6-part crons succeed - await instanceManagerClient.Update(new InstanceUpdateRequest + updated = await instanceManagerClient.Update(new InstanceUpdateRequest { Id = firstTest.Id, AutoUpdateCron = "0 0 0 1 1 *" }, cancellationToken); + Assert.AreEqual("0 0 0 1 1 *", updated.AutoUpdateCron); + Assert.AreEqual(0U, updated.AutoUpdateInterval); + //can't move online instance await ApiAssert.ThrowsException(() => instanceManagerClient.Update(new InstanceUpdateRequest {