r"""Wait for the API Server to be ready. Args: timeout (int): The number of seconds to wait. (default: :obj: `10`) Returns: bool: Whether the API Server is ready.
(self, timeout: int = 10)
| 159 | return False |
| 160 | |
| 161 | def wait(self, timeout: int = 10) -> bool: |
| 162 | r"""Wait for the API Server to be ready. |
| 163 | |
| 164 | Args: |
| 165 | timeout (int): The number of seconds to wait. (default: :obj: `10`) |
| 166 | |
| 167 | Returns: |
| 168 | bool: Whether the API Server is ready. |
| 169 | """ |
| 170 | for _ in range(timeout): |
| 171 | if self.ok: |
| 172 | return True |
| 173 | time.sleep(1) |
| 174 | return False |
| 175 | |
| 176 | def __del__(self): |
| 177 | r"""Clean up the API server when the object is deleted.""" |