Skip to content

Commit 0121584

Browse files
author
Haiping Chen
committed
PerInstanceCache = true
1 parent 2a52e30 commit 0121584

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@ namespace BotSharp.Core.Agents.Services;
44

55
public partial class AgentService
66
{
7-
#if !DEBUG
8-
[MemoryCache(10 * 60)]
9-
#endif
7+
[MemoryCache(10 * 60, PerInstanceCache = true)]
108
public async Task<List<Agent>> GetAgents(bool? allowRouting = null)
119
{
1210
var agents = _db.GetAgents(allowRouting: allowRouting);
1311
return await Task.FromResult(agents);
1412
}
1513

16-
#if !DEBUG
17-
[MemoryCache(10 * 60)]
18-
#endif
14+
[MemoryCache(10 * 60, PerInstanceCache = true)]
1915
public async Task<Agent> GetAgent(string id)
2016
{
2117
var profile = _db.GetAgent(id);

src/Infrastructure/BotSharp.Core/Repository/FileRepository.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,6 @@ public List<string> GetAgentResponses(string agentId, string prefix, string inte
486486
return responses;
487487
}
488488

489-
#if !DEBUG
490-
[MemoryCache(10 * 60)]
491-
#endif
492489
public Agent? GetAgent(string agentId)
493490
{
494491
var agentDir = Path.Combine(_dbSettings.FileRepository, _agentSettings.DataDir);

0 commit comments

Comments
 (0)