Skip to content

Commit

Permalink
update model undeploy status
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed May 8, 2024
1 parent 8925ce8 commit a85bcdf
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
Expand Down Expand Up @@ -80,11 +81,9 @@ private void waitModelUndeployed(String modelId) {
Predicate<Response> condition = response -> {
try {
Map<String, Object> responseInMap = parseResponseToMap(response);
String state = responseInMap.get(MLModel.MODEL_STATE_FIELD).toString();
return !state.equals(MLModelState.DEPLOYED.toString())
&& !state.equals(MLModelState.DEPLOYING.toString())
&& !state.equals(MLModelState.PARTIALLY_DEPLOYED.toString());
} catch (IOException e) {
MLModelState state = MLModelState.from(responseInMap.get(MLModel.MODEL_STATE_FIELD).toString());
return Set.of(MLModelState.UNDEPLOYED, MLModelState.DEPLOY_FAILED).contains(state);
} catch (Exception e) {
return false;
}
};
Expand Down

0 comments on commit a85bcdf

Please sign in to comment.