소스 검색

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)
     myLogger.info_logger("code="+code)
     return code, message
     return code, message
 
 
-
 def prepare_app(app_name, customer_name):
 def prepare_app(app_name, customer_name):
     library_path = "/data/library/apps/" + app_name
     library_path = "/data/library/apps/" + app_name
     install_path = "/data/apps/" + customer_name
     install_path = "/data/apps/" + customer_name
     shell_execute.execute_command_output_all("cp -r " + library_path + " " + install_path)
     shell_execute.execute_command_output_all("cp -r " + library_path + " " + install_path)
 
 
-
 def install_app_delay(app_name, customer_name, app_version):
 def install_app_delay(app_name, customer_name, app_version):
     job_id = app_name + "_" + customer_name
     job_id = app_name + "_" + customer_name
 
 
@@ -252,11 +250,9 @@ def app_exits_in_docker(app_id):
     myLogger.info_logger("APP info: " + info)
     myLogger.info_logger("APP info: " + info)
     return info, flag
     return info, flag
 
 
-
 def split_app_id(app_id):
 def split_app_id(app_id):
     return app_id.split("_")[1]
     return app_id.split("_")[1]
 
 
-
 def get_apps_from_compose(output_list):
 def get_apps_from_compose(output_list):
     ip_result = shell_execute.execute_command_output_all("curl ifconfig.me")
     ip_result = shell_execute.execute_command_output_all("curl ifconfig.me")
     ip = ip_result["result"]
     ip = ip_result["result"]
@@ -362,12 +358,12 @@ def check_app_rq(app_id):
     myLogger.info_logger(queue_job_ids)
     myLogger.info_logger(queue_job_ids)
     myLogger.info_logger(run_job_ids)
     myLogger.info_logger(run_job_ids)
     myLogger.info_logger(failed_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
     return False