Skip to content

Commit

Permalink
Fix delete local model twice quickly get 500 response issue
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <[email protected]>
  • Loading branch information
zane-neo committed Aug 6, 2024
1 parent 3599816 commit 76f3cd5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ protected void doExecute(Task task, ActionRequest request, ActionListener<Delete
@VisibleForTesting
void deleteModelChunks(String modelId, Boolean isHidden, ActionListener<Boolean> actionListener) {
DeleteByQueryRequest deleteModelsRequest = new DeleteByQueryRequest(ML_MODEL_INDEX);
deleteModelsRequest.setQuery(new TermsQueryBuilder(MODEL_ID_FIELD, modelId));
deleteModelsRequest.setQuery(new TermsQueryBuilder(MODEL_ID_FIELD, modelId)).setRefresh(true);

client.execute(DeleteByQueryAction.INSTANCE, deleteModelsRequest, ActionListener.wrap(r -> {
if ((r.getBulkFailures() == null || r.getBulkFailures().size() == 0)
Expand Down

0 comments on commit 76f3cd5

Please sign in to comment.