Skip to content

Commit 18e318b

Browse files
committed
disable cache in local
1 parent 4b6c325 commit 18e318b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ join u in db.Users on ua.UserId equals u.Id
1616
return query.ToList();
1717
}
1818

19+
#if !DEBUG
1920
[MemoryCache(10 * 60)]
21+
#endif
2022
public async Task<Agent> GetAgent(string id)
2123
{
2224
var db = _services.GetRequiredService<IBotSharpRepository>();

src/Infrastructure/BotSharp.Core/Routing/RouteToAgentFn.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private bool HasMissingRequiredField(RoleDialogModel message, out string agentId
9696
{
9797
// Add field to args
9898
message.FunctionArgs = AppendPropertyToArgs(message.FunctionArgs, "missing_fields", missingFields);
99-
message.ExecutionResult = $"missing some information";
99+
message.ExecutionResult = $"missing some information: [{string.Join(',', missingFields)}]";
100100

101101
// Handle redirect
102102
if (!string.IsNullOrEmpty(routingRule.RedirectTo))
@@ -107,6 +107,11 @@ private bool HasMissingRequiredField(RoleDialogModel message, out string agentId
107107
// Add redirected agent
108108
message.FunctionArgs = AppendPropertyToArgs(message.FunctionArgs, "redirect_to", agent.Name);
109109
}
110+
else
111+
{
112+
// back to router
113+
agentId = message.CurrentAgentId;
114+
}
110115
}
111116

112117
return missingFields.Any();

src/Infrastructure/BotSharp.Core/Routing/Router.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public virtual async Task<Agent> LoadRouter()
2828
return await agentService.LoadAgent(AgentId);
2929
}
3030

31+
#if !DEBUG
3132
[MemoryCache(10 * 60)]
33+
#endif
3234
public RoutingItem[] GetRoutingRecords()
3335
{
3436
var db = _services.GetRequiredService<IBotSharpRepository>();

0 commit comments

Comments
 (0)