diff --git a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs index 6b749b3b..5912b1e0 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs @@ -4,18 +4,14 @@ namespace BotSharp.Core.Agents.Services; public partial class AgentService { -#if !DEBUG - [MemoryCache(10 * 60)] -#endif + [MemoryCache(10 * 60, PerInstanceCache = true)] public async Task> GetAgents(bool? allowRouting = null) { var agents = _db.GetAgents(allowRouting: allowRouting); return await Task.FromResult(agents); } -#if !DEBUG - [MemoryCache(10 * 60)] -#endif + [MemoryCache(10 * 60, PerInstanceCache = true)] public async Task GetAgent(string id) { var profile = _db.GetAgent(id); diff --git a/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs b/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs index a1779c34..8aed5989 100644 --- a/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs +++ b/src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs @@ -486,9 +486,6 @@ public class FileRepository : IBotSharpRepository return responses; } -#if !DEBUG - [MemoryCache(10 * 60)] -#endif public Agent? GetAgent(string agentId) { var agentDir = Path.Combine(_dbSettings.FileRepository, _agentSettings.DataDir);