From ae361db3bf19c6f5d644e5e313cca90c23245f2a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2023 15:24:49 +0900 Subject: [PATCH] Allow disabling processors via envvar because kubernetes cruft --- .../Commands/Queue/WatchQueueCommand.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/WatchQueueCommand.cs b/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/WatchQueueCommand.cs index 75023af9..64bd6bb1 100644 --- a/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/WatchQueueCommand.cs +++ b/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/WatchQueueCommand.cs @@ -19,6 +19,16 @@ public class WatchQueueCommand public Task OnExecuteAsync(CancellationToken cancellationToken) { + string? disabledProcessorsEnv = Environment.GetEnvironmentVariable("DISABLED_PROCESSORS"); + + if (!string.IsNullOrEmpty(disabledProcessorsEnv)) + { + if (!string.IsNullOrEmpty(DisabledProcessors)) + throw new ArgumentException("Attempted to specify disabled processors via parameter and environment at the same time"); + + DisabledProcessors = disabledProcessorsEnv; + } + ScoreStatisticsQueueProcessor queue = new ScoreStatisticsQueueProcessor(DisabledProcessors.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries)); queue.Run(cancellationToken);