PerInstanceCache = true

This commit is contained in:
Haiping Chen 2023-10-26 09:18:14 -05:00
parent 2a52e30ba8
commit 012158470f
2 changed files with 2 additions and 9 deletions

View file

@ -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<List<Agent>> 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<Agent> GetAgent(string id)
{
var profile = _db.GetAgent(id);

View file

@ -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);