Skip to content

Commit

Permalink
fix async return value problem
Browse files Browse the repository at this point in the history
Signed-off-by: HenryL27 <[email protected]>
  • Loading branch information
HenryL27 committed Oct 12, 2023
1 parent e379420 commit 0d116af
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public void createConversation(ActionListener<String> listener) {
public void getConversations(int from, int maxResults, ActionListener<List<ConversationMeta>> listener) {
if (!clusterService.state().metadata().hasIndex(indexName)) {
listener.onResponse(List.of());
return;
}
SearchRequest request = Requests.searchRequest(indexName);
String userstr = client.threadPool().getThreadContext().getTransient(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT);
Expand Down Expand Up @@ -226,6 +227,7 @@ public void getConversations(int maxResults, ActionListener<List<ConversationMet
public void deleteConversation(String conversationId, ActionListener<Boolean> listener) {
if (!clusterService.state().metadata().hasIndex(indexName)) {
listener.onResponse(true);
return;
}
DeleteRequest delRequest = Requests.deleteRequest(indexName).id(conversationId);
String userstr = client.threadPool().getThreadContext().getTransient(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT);
Expand Down

0 comments on commit 0d116af

Please sign in to comment.