Skip to content

Commit 964797d

Browse files
authored
[HWORKS-125] Add missing status to deployment.save() method (#161)
1 parent 94827d5 commit 964797d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

python/hsml/engine/serving_engine.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,11 @@ def save(self, deployment_instance, await_update: int):
355355
"Deployment is starting, please wait until it is running before applying changes. \n"
356356
+ "Check the current status by using `.get_state()` or explore the server logs using `.get_logs()`"
357357
)
358-
if state.status == PREDICTOR_STATE.STATUS_RUNNING:
358+
if (
359+
state.status == PREDICTOR_STATE.STATUS_RUNNING
360+
or state.status == PREDICTOR_STATE.STATUS_IDLE
361+
or state.status == PREDICTOR_STATE.STATUS_FAILED
362+
):
359363
# if running, it's fine
360364
self._serving_api.put(deployment_instance)
361365
print("Deployment updated, applying changes to running instances...")
@@ -379,7 +383,10 @@ def save(self, deployment_instance, await_update: int):
379383
"Deployment is stopping, please wait until it is stopped before applying changes"
380384
)
381385
return
382-
if state.status == PREDICTOR_STATE.STATUS_STOPPED:
386+
if (
387+
state.status == PREDICTOR_STATE.STATUS_CREATED
388+
or state.status == PREDICTOR_STATE.STATUS_STOPPED
389+
):
383390
# if stopped, it's fine
384391
self._serving_api.put(deployment_instance)
385392
print("Deployment updated, explore it at " + deployment_instance.get_url())

0 commit comments

Comments
 (0)