瀏覽代碼

Update manage.py

qiaofeng1227 2 年之前
父節點
當前提交
0e96145c2b
共有 1 個文件被更改,包括 6 次插入10 次删除
  1. 6 10
      appmanage/api/service/manage.py

+ 6 - 10
appmanage/api/service/manage.py

@@ -190,13 +190,11 @@ def check_app(app_name, customer_name, app_version):
     myLogger.info_logger("code="+code)
     return code, message
 
-
 def prepare_app(app_name, customer_name):
     library_path = "/data/library/apps/" + app_name
     install_path = "/data/apps/" + customer_name
     shell_execute.execute_command_output_all("cp -r " + library_path + " " + install_path)
 
-
 def install_app_delay(app_name, customer_name, app_version):
     job_id = app_name + "_" + customer_name
 
@@ -252,11 +250,9 @@ def app_exits_in_docker(app_id):
     myLogger.info_logger("APP info: " + info)
     return info, flag
 
-
 def split_app_id(app_id):
     return app_id.split("_")[1]
 
-
 def get_apps_from_compose(output_list):
     ip_result = shell_execute.execute_command_output_all("curl ifconfig.me")
     ip = ip_result["result"]
@@ -362,12 +358,12 @@ def check_app_rq(app_id):
     myLogger.info_logger(queue_job_ids)
     myLogger.info_logger(run_job_ids)
     myLogger.info_logger(failed_job_ids)
-    if app_id in queue_job_ids:
-        return True    
-    if app_id in run_job_ids:
-        return True
-    if app_id in failed_job_ids:
-        return True
+    if not any(queue_job_ids) or not any(app_id in i for i in queue_job_ids):
+        return True 
+    if not any(failed_job_ids) or not any(app_id in i for i in failed_job_ids):
+        return True  
+    if not any(run_job_ids) or not any(app_id in i for i in run_job_ids):
+        return True 
 
     return False