File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/bentoml/_internal/cloud Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
from bentoml ._internal .cloud .client import RestApiClient
6
6
7
+ from .base import Spinner
7
8
from .bento import BentoAPI
8
9
from .config import DEFAULT_ENDPOINT
9
10
from .config import CloudClientConfig
@@ -50,8 +51,9 @@ def __init__(
50
51
endpoint = ctx .endpoint
51
52
52
53
client = RestApiClient (endpoint , api_key , timeout )
53
- bento = BentoAPI (client )
54
- model = ModelAPI (client )
54
+ spinner = Spinner ()
55
+ bento = BentoAPI (client , spinner = spinner )
56
+ model = ModelAPI (client , spinner = spinner )
55
57
deployment = DeploymentAPI (client )
56
58
secret = SecretAPI (client )
57
59
Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ def __init__(self, console: Console | None = None) -> None:
119
119
)
120
120
self ._spinner_task_id : t .Optional [TaskID ] = None
121
121
self ._live = Live (self , console = self .console )
122
+ self ._start_count = 0
122
123
123
124
@contextmanager
124
125
def spin (self , text : str ) -> t .Generator [TaskID , None , None ]:
@@ -150,10 +151,14 @@ def __rich_console__(
150
151
151
152
def start (self ) -> None :
152
153
"""Start live updating."""
154
+ self ._start_count += 1
153
155
self ._live .start ()
154
156
155
157
def stop (self ) -> None :
156
158
"""Stop live updating."""
159
+ self ._start_count -= 1
160
+ if self ._start_count > 0 :
161
+ return
157
162
if self ._spinner_task_id is not None :
158
163
self ._spinner_progress .remove_task (self ._spinner_task_id )
159
164
self ._spinner_task_id = None
You can’t perform that action at this time.
0 commit comments