Revert to a lock

This commit is contained in:
hulkhan22
2025-04-26 23:56:48 +02:00
parent 7e13c8c446
commit baed8d2b90
@@ -39,6 +39,7 @@ public class BotController(
{
private readonly BotConfig _botConfig = _configServer.GetConfig<BotConfig>();
private readonly PmcConfig _pmcConfig = _configServer.GetConfig<PmcConfig>();
private static readonly Lock BotListLock = new();
/// <summary>
/// Return the number of bot load-out varieties to be generated
@@ -201,7 +202,10 @@ public class BotController(
condition.Limit), // Choose largest between value passed in from request vs what's in bot.config
_botHelper.IsBotPmc(condition.Role));
result.AddRange(GenerateBotWave(condition, botWaveGenerationDetails, sessionId));
lock (BotListLock)
{
result.AddRange(GenerateBotWave(condition, botWaveGenerationDetails, sessionId));
}
})).ToArray());
stopwatch.Stop();