Skip to content

Commit

Permalink
Removed SUCCESS as a terminal state
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-beauregard committed Oct 8, 2020
1 parent e93f26e commit 4808bee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -805,12 +805,11 @@ public PollerFlux<PhoneNumberSearch, PhoneNumberSearch> beginCreateSearch(
getSearchById(pollingContext.getLatestResponse().getValue().getSearchId())
.flatMap(getSearchResponse -> {
SearchStatus status = getSearchResponse.getStatus();
if (status.equals(SearchStatus.SUCCESS)
|| status.equals(SearchStatus.EXPIRED)
if (status.equals(SearchStatus.EXPIRED)
|| status.equals(SearchStatus.CANCELLED)
|| status.equals(SearchStatus.RESERVED)) {
return Mono.just(new PollResponse<>(
LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, getSearchResponse));
return Mono.just(new PollResponse<>(
LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, getSearchResponse));
}
if (status.equals(SearchStatus.ERROR)) {
return Mono.just(new PollResponse<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.azure.communication.common.PhoneNumber;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.Response;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.core.util.Context;
import org.junit.jupiter.api.Test;
Expand Down

0 comments on commit 4808bee

Please sign in to comment.