Skip to content

Commit

Permalink
Fix delete local model twice quickly get 500 response issue (#2806)
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <[email protected]>
  • Loading branch information
zane-neo authored Aug 7, 2024
1 parent 920685d commit 1071a48
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 1071a48

Please sign in to comment.