- if total_timeout is None:
- total_timeout = 3600
- end = time.time() + total_timeout
- while time.time() < end:
- models = await controller.list_models()
- if model_name not in models:
- self.log.debug(
- "The model {} ({}) was destroyed".format(model_name, uuid)
- )
- return
+ :param: model: Model name to be removed
+ :param: controller: Controller object
+ :param: timeout: Timeout in seconds
+ """
+
+ async def _destroy_model_loop(model_name: str, controller: Controller):
+ while await self.model_exists(model_name, controller=controller):
+ await controller.destroy_model(
+ model_name, destroy_storage=True, force=True, max_wait=0
+ )