Skip to content

Commit

Permalink
fix WaitForTask timeout in case of a task cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
the-sinner committed May 20, 2024
1 parent 3edd5b9 commit 05017a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/meilisearch/sdk/TasksHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void waitForTask(int taskUid, int timeoutInMs, int intervalInMs) throws Meilisea
long elapsedTime = 0;

while (status == null
|| (!status.equals(TaskStatus.SUCCEEDED) && !status.equals(TaskStatus.FAILED))) {
|| (status.equals(TaskStatus.ENQUEUED) || status.equals(TaskStatus.PROCESSING))) {
if (elapsedTime >= timeoutInMs) {
throw new MeilisearchTimeoutException();
}
Expand Down

0 comments on commit 05017a1

Please sign in to comment.