Skip to content

Commit

Permalink
Merge pull request #166 from meilisearch/improve-wfpu
Browse files Browse the repository at this point in the history
Update waitForPendingUpdate method
  • Loading branch information
alallema authored Jul 5, 2021
2 parents 20c79db + 47779e2 commit 2e07f9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (i Index) WaitForPendingUpdate(
if err != nil {
return UpdateStatusUnknown, nil
}
if update.Status != UpdateStatusEnqueued {
if update.Status != UpdateStatusEnqueued && update.Status != UpdateStatusProcessing {
return update.Status, nil
}
time.Sleep(interval)
Expand Down
2 changes: 2 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ const (
UpdateStatusUnknown UpdateStatus = "unknown"
// UpdateStatusEnqueued means the server know the update but didn't handle it yet
UpdateStatusEnqueued UpdateStatus = "enqueued"
// UpdateStatusProcessing means the server is processing the update and all went well
UpdateStatusProcessing UpdateStatus = "processing"
// UpdateStatusProcessed means the server has processed the update and all went well
UpdateStatusProcessed UpdateStatus = "processed"
// UpdateStatusFailed means the server has processed the update and an error has been reported
Expand Down

0 comments on commit 2e07f9b

Please sign in to comment.