Skip to content

Commit a38bd4e

Browse files
committed
Non-stable or canary version cache
1 parent 80fa193 commit a38bd4e

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/Common/Enums/ReleaseChannel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
public enum ReleaseChannel
44
{
55
Stable,
6-
Canary
6+
Canary,
7+
Custom1
78
}
89

910
public static partial class EnumExtensions
@@ -20,6 +21,7 @@ public static bool TryParseAsReleaseChannel(this string? rawRc, out ReleaseChann
2021
{
2122
"stable" => ReleaseChannel.Stable,
2223
"canary" => ReleaseChannel.Canary,
24+
"custom1" => ReleaseChannel.Custom1,
2325
_ => null
2426
};
2527

src/Server/Services/GitLab/VersionCache.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,5 +250,14 @@ public static void InitializeVersionCaches(WebApplication app)
250250
canaryCache.Init(canarySource,
251251
new PinnedVersions(pvLogger, vpSection.GetSection("Canary")));
252252
}
253+
254+
var custom1Source = versionCacheSection.GetValue<string>("Custom1");
255+
256+
if (custom1Source != null)
257+
{
258+
var canaryCache = app.Services.GetRequiredKeyedService<VersionCache>("custom1Cache");
259+
canaryCache.Init(custom1Source,
260+
new PinnedVersions(pvLogger, vpSection.GetSection("Custom1")));
261+
}
253262
}
254263
}

0 commit comments

Comments
 (0)