Skip to content

Commit

Permalink
fix: add scaled to zero in client (#4712)
Browse files Browse the repository at this point in the history
Signed-off-by: FogDong <fog@bentoml.com>
  • Loading branch information
FogDong committed May 7, 2024
1 parent 6de2041 commit e19f765
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/bentoml/_internal/cloud/deployment.py
Expand Up @@ -453,7 +453,10 @@ def get_client(
from _bentoml_impl.client import SyncHTTPClient

self._refetch()
if self._schema.status != DeploymentStatus.Running.value:
if (
self._schema.status != DeploymentStatus.Running.value
and self._schema.status != DeploymentStatus.ScaledToZero.value
):
raise BentoMLException(f"Deployment status is {self._schema.status}")
if self._urls is None or len(self._urls) != 1:
raise BentoMLException("Deployment url is not ready")
Expand All @@ -468,7 +471,10 @@ def get_async_client(
from _bentoml_impl.client import AsyncHTTPClient

self._refetch()
if self._schema.status != DeploymentStatus.Running.value:
if (
self._schema.status != DeploymentStatus.Running.value
and self._schema.status != DeploymentStatus.ScaledToZero.value
):
raise BentoMLException(f"Deployment status is {self._schema.status}")
if self._urls is None or len(self._urls) != 1:
raise BentoMLException("Deployment url is not ready")
Expand Down

0 comments on commit e19f765

Please sign in to comment.