Skip to content

Commit 94cff58

Browse files
committed
Updated pr.
1 parent adc4431 commit 94cff58

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

ads/model/deployment/model_deployment.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
DELETE_WORKFLOW_STEPS = 2
6565
DEACTIVATE_WORKFLOW_STEPS = 2
6666
DEFAULT_RETRYING_REQUEST_ATTEMPTS = 3
67-
TERMINAL_STATES = [State.FAILED, State.DELETED, State.INACTIVE]
67+
TERMINAL_STATES = [State.ACTIVE, State.FAILED, State.DELETED, State.INACTIVE]
68+
WATCH_TERMINAL_STATES = [State.FAILED, State.DELETED, State.INACTIVE]
6869

6970
MODEL_DEPLOYMENT_KIND = "deployment"
7071
MODEL_DEPLOYMENT_TYPE = "modelDeployment"
@@ -748,12 +749,7 @@ def watch(
748749
The instance of ModelDeployment.
749750
"""
750751
status = ""
751-
while self.state not in [
752-
State.ACTIVE,
753-
State.FAILED,
754-
State.DELETED,
755-
State.INACTIVE
756-
]:
752+
while self.state not in TERMINAL_STATES:
757753
status = self._check_and_print_status(status)
758754
time.sleep(interval)
759755

@@ -777,8 +773,8 @@ def watch(
777773
pass
778774

779775
def _stop_condition(self):
780-
"""Stops the sync once the model deployment is in a terminal state."""
781-
return self.state in TERMINAL_STATES
776+
"""Stops the watch sync once the model deployment is in a terminal state."""
777+
return self.state in WATCH_TERMINAL_STATES
782778

783779
def _check_and_print_status(self, prev_status) -> str:
784780
"""Check and print the next status.

0 commit comments

Comments
 (0)