Skip to content

Commit

Permalink
Allow disabling processors via envvar because kubernetes cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Nov 15, 2023
1 parent 87a0efe commit ae361db
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ public class WatchQueueCommand

public Task<int> 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);
Expand Down

0 comments on commit ae361db

Please sign in to comment.