Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
n1v0lg committed Sep 13, 2024
1 parent 979e002 commit b944a7c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ public void onStateRecovered(Consumer<State> recoveredStateConsumer) {
}

/**
* Notifies listener once when the security index becomes available for search, or calls on failure on timeout.
* Waits up to {@code timeout} for the security index to become available for search, based on cluster state updates.
* Notifies {@code listener} once the security index is available for search, or calls {@code onFailure} on {@code timeout}.
*/
public void whenIndexAvailableForSearch(ActionListener<Void> listener, TimeValue timeout) {
if (state.indexAvailableForSearch) {
Expand All @@ -388,7 +389,7 @@ public void accept(SecurityIndexManager.State previousState, SecurityIndexManage
}
};

// schedule cancellation on timeout -- keep reference to cancellable so a successful completion can cancel the timeout
// schedule failure handling on timeout -- keep reference to cancellable so a successful completion can cancel the timeout
indexAvailableForSearchListener.cancellable = client.threadPool().schedule(() -> {
removeStateListener(indexAvailableForSearchListener);
notifyOnceListener.onFailure(
Expand Down

0 comments on commit b944a7c

Please sign in to comment.