diff --git a/src/Tgstation.Server.Host/GraphQL/Types/UpdateInformation.cs b/src/Tgstation.Server.Host/GraphQL/Types/UpdateInformation.cs index 27e758bd79..937e07b69a 100644 --- a/src/Tgstation.Server.Host/GraphQL/Types/UpdateInformation.cs +++ b/src/Tgstation.Server.Host/GraphQL/Types/UpdateInformation.cs @@ -58,7 +58,7 @@ namespace Tgstation.Server.Host.GraphQL.Types /// The for the operation. /// The of the GitHub repository updates are sourced from on success. if a GitHub API error occurred. public async ValueTask TrackedRepositoryUrl( - bool forceFresh, + bool? forceFresh, [Service] IGraphQLAuthorityInvoker administrationAuthority, CancellationToken cancellationToken) => (await GetAdministrationResponseSafe(forceFresh, administrationAuthority, cancellationToken)).TrackedRepositoryUrl; @@ -82,7 +82,7 @@ namespace Tgstation.Server.Host.GraphQL.Types /// The for the operation. /// The of the latest TGS version on success. if a GitHub API error occurred. public async ValueTask LatestVersion( - bool forceFresh, + bool? forceFresh, [Service] IGraphQLAuthorityInvoker administrationAuthority, CancellationToken cancellationToken) => (await GetAdministrationResponseSafe(forceFresh, administrationAuthority, cancellationToken)).LatestVersion; @@ -95,20 +95,21 @@ namespace Tgstation.Server.Host.GraphQL.Types /// The for the operation. /// A resulting in the from the . async ValueTask GetAdministrationResponseSafe( - bool forceFresh, + bool? forceFresh, IGraphQLAuthorityInvoker administrationAuthority, CancellationToken cancellationToken) { using (await SemaphoreSlimContext.Lock(cacheReadSemaphore, cancellationToken)) { + forceFresh ??= false; if (cacheForceGenerated) forceFresh = false; else - cacheForceGenerated |= forceFresh; + cacheForceGenerated |= forceFresh.Value; ArgumentNullException.ThrowIfNull(administrationAuthority); var response = await administrationAuthority.Invoke( - authority => authority.GetUpdateInformation(forceFresh, cancellationToken)); + authority => authority.GetUpdateInformation(forceFresh.Value, cancellationToken)); return response; }