Skip to content

Commit 3624ec8

Browse files
authored
Merge pull request #881 from iceljc/master
rename and add cache
2 parents e0cfb18 + 00c8e8c commit 3624ec8

File tree

6 files changed

+638
-635
lines changed

6 files changed

+638
-635
lines changed

src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ Task<bool> SendMessage(string agentId,
7171
/// <param name="convLimit">conversation limit</param>
7272
/// <param name="preLoad">if pre-loading, then keys are not filter by the search query</param>
7373
/// <returns></returns>
74-
Task<List<string>> GetConversationSearhKeys(string query, int convlimit = 100, int keyLimit = 10, bool preLoad = false);
74+
Task<List<string>> GetConversationStateSearhKeys(string query, int convlimit = 100, int keyLimit = 10, bool preLoad = false);
7575
}

src/Infrastructure/BotSharp.Abstraction/Repositories/IBotSharpRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ List<string> GetIdleConversations(int batchSize, int messageLimit, int bufferHou
148148
=> throw new NotImplementedException();
149149
List<string> TruncateConversation(string conversationId, string messageId, bool cleanLog = false)
150150
=> throw new NotImplementedException();
151-
List<string> GetConversationSearchKeys(int messageLimit = 2, int convlimit = 100)
151+
List<string> GetConversationStateSearchKeys(int messageLowerLimit = 2, int convUpperlimit = 100)
152152
=> throw new NotImplementedException();
153153
#endregion
154154

src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public void SaveStates()
222222
_state.Save();
223223
}
224224

225-
public async Task<List<string>> GetConversationSearhKeys(string query, int convlimit = 100, int keyLimit = 10, bool preLoad = false)
225+
public async Task<List<string>> GetConversationStateSearhKeys(string query, int convlimit = 100, int keyLimit = 10, bool preLoad = false)
226226
{
227227
var keys = new List<string>();
228228
if (!preLoad && string.IsNullOrWhiteSpace(query))
@@ -231,7 +231,7 @@ public async Task<List<string>> GetConversationSearhKeys(string query, int convl
231231
}
232232

233233
var db = _services.GetRequiredService<IBotSharpRepository>();
234-
keys = db.GetConversationSearchKeys(convlimit: convlimit);
234+
keys = db.GetConversationStateSearchKeys(convUpperlimit: convlimit);
235235
keys = preLoad ? keys : keys.Where(x => x.Contains(query, StringComparison.OrdinalIgnoreCase)).ToList();
236236
return keys.OrderBy(x => x).Take(keyLimit).ToList();
237237
}

0 commit comments

Comments
 (0)