Bläddra i källkod

Update docker.py

qiaofeng1227 2 år sedan
förälder
incheckning
4d5a699ccf
1 ändrade filer med 4 tillägg och 4 borttagningar
  1. 4 4
      appmanage/api/utils/docker.py

+ 4 - 4
appmanage/api/utils/docker.py

@@ -15,11 +15,11 @@ def get_process_perc(app_name):
     if int(code) == 0 and output["result"] != "":
         process_now = "starting"
     
-    output = shell_execute.execute_command_output_all("sudo docker compose ls |grep  " + app_name)
+    output = shell_execute.execute_command_output_all("docker inspect " +  app_name + "|grep error")
     code = output["code"]
-    if int(code) == 0 and output["result"] != "":
-        process_now = "running"
-
+    if int(code) == 0 and output["result"] == "":
+        process_now = "Initializing"
+    
     return process_now
 
 def check_vm_resource():