PerInstanceCache = true
This commit is contained in:
parent
2a52e30ba8
commit
012158470f
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue