From de9207fb333a4080ea85fc20d4d30975e5472aaa Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 11 Jan 2026 15:25:34 -0500 Subject: [PATCH] Fix bad GitHub token expiry logic --- src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs index 88922870f8..c076efd59d 100644 --- a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs +++ b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs @@ -31,7 +31,7 @@ namespace Tgstation.Server.Host.Utils.GitHub const uint ClientCacheHours = 1; /// - /// Minutes before tokens expire before not using them. + /// Minutes before tokens expire before we stop using them for safety. /// const uint AppTokenExpiryGraceMinutes = 15; @@ -144,7 +144,7 @@ namespace Tgstation.Server.Host.Utils.GitHub var now = DateTimeOffset.UtcNow; cacheHit = clientCache.TryGetValue(cacheKey, out var tuple); - var tokenValid = cacheHit && (!tuple.Expiry.HasValue || tuple.Expiry.Value <= now); + var tokenValid = cacheHit && (!tuple.Expiry.HasValue || tuple.Expiry.Value > now); if (!tokenValid) { if (cacheHit)