diff --git a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs
index 4cf31a5d289..8e222609daf 100644
--- a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs
+++ b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs
@@ -22,10 +22,10 @@ namespace Tgstation.Server.Host.Utils.GitHub
sealed class GitHubClientFactory : IGitHubClientFactory, IDisposable
{
///
- /// Limit to the amount of days a can live in the .
+ /// Limit to the amount of hours a can live in the .
///
- /// God forbid someone leak server memory by constantly changing an instance's GitHub token.
- const uint ClientCacheDays = 7;
+ /// Set to app installation token lifetime, which is the lowest. See https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app.
+ const uint ClientCacheHours = 1;
///
/// The used in place of when accessing a configuration-based client with no token set in .
@@ -220,7 +220,7 @@ public async ValueTask CreateClient(string accessToken, Cancellat
// Prune the cache
var purgeCount = 0U;
- var purgeAfter = now.AddDays(-ClientCacheDays);
+ var purgeAfter = now.AddHours(-ClientCacheHours);
foreach (var key in clientCache.Keys.ToList())
{
if (key == cacheKey)
@@ -236,9 +236,9 @@ public async ValueTask CreateClient(string accessToken, Cancellat
if (purgeCount > 0)
logger.LogDebug(
- "Pruned {count} expired GitHub client(s) from cache that haven't been used in {purgeAfterHours} days.",
+ "Pruned {count} expired GitHub client(s) from cache that haven't been used in {purgeAfterHours} hours.",
purgeCount,
- ClientCacheDays);
+ ClientCacheHours);
}
var rateLimitInfo = client.GetLastApiInfo()?.RateLimit;