heyudev 2 سال پیش
والد
کامیت
5c755b613f
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      longvideo_update.py

+ 4 - 0
longvideo_update.py

@@ -121,13 +121,17 @@ def remove_container_image(client, instance_id, container_name_list):
             logging.error(f"容器不存在或者无法删除当前容器, instance = {instance_id}/{ip_address}")
             sys.exit()
         try:
+            flag = False
             for container_name in container_name_list:
                 try:
                     container_id = client.containers.get(container_name)
                     container_id.remove(force=True)
+                    flag = True
                     break
                 except:
                     continue
+            if flag:
+                break
         except Exception as e:
             i += 1