diff --git a/src/Infrastructure/BotSharp.OpenAPI/BackgroundServices/ConversationTimeoutService.cs b/src/Infrastructure/BotSharp.OpenAPI/BackgroundServices/ConversationTimeoutService.cs index a409ea14..4e76dc06 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/BackgroundServices/ConversationTimeoutService.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/BackgroundServices/ConversationTimeoutService.cs @@ -62,7 +62,11 @@ namespace BotSharp.OpenAPI.BackgroundServices if (cleanSetting == null || !cleanSetting.Enable) return; var conversationService = scope.ServiceProvider.GetRequiredService(); - var conversationIds = await conversationService.GetIdleConversations(cleanSetting.BatchSize, cleanSetting.MessageLimit, cleanSetting.BufferHours, cleanSetting.ExcludeAgentIds); + var batchSize = cleanSetting.BatchSize; + var limit = cleanSetting.MessageLimit; + var bufferHours = cleanSetting.BufferHours; + var excludeAgentIds = cleanSetting.ExcludeAgentIds ?? new List(); + var conversationIds = await conversationService.GetIdleConversations(batchSize, limit, bufferHours, excludeAgentIds); if (!conversationIds.IsNullOrEmpty()) {