disable cache in local

This commit is contained in:
hchen 2023-09-14 20:19:32 -05:00
parent 4b6c32586c
commit 18e318b2a3
3 changed files with 10 additions and 1 deletions

View file

@ -16,7 +16,9 @@ public partial class AgentService
return query.ToList();
}
#if !DEBUG
[MemoryCache(10 * 60)]
#endif
public async Task<Agent> GetAgent(string id)
{
var db = _services.GetRequiredService<IBotSharpRepository>();

View file

@ -96,7 +96,7 @@ public class RouteToAgentFn : IFunctionCallback
{
// Add field to args
message.FunctionArgs = AppendPropertyToArgs(message.FunctionArgs, "missing_fields", missingFields);
message.ExecutionResult = $"missing some information";
message.ExecutionResult = $"missing some information: [{string.Join(',', missingFields)}]";
// Handle redirect
if (!string.IsNullOrEmpty(routingRule.RedirectTo))
@ -107,6 +107,11 @@ public class RouteToAgentFn : IFunctionCallback
// Add redirected agent
message.FunctionArgs = AppendPropertyToArgs(message.FunctionArgs, "redirect_to", agent.Name);
}
else
{
// back to router
agentId = message.CurrentAgentId;
}
}
return missingFields.Any();

View file

@ -28,7 +28,9 @@ public class Router : IAgentRouting
return await agentService.LoadAgent(AgentId);
}
#if !DEBUG
[MemoryCache(10 * 60)]
#endif
public RoutingItem[] GetRoutingRecords()
{
var db = _services.GetRequiredService<IBotSharpRepository>();