Merge remote-tracking branch 'origin/main'

This commit is contained in:
TooY 2023-04-16 21:55:05 +08:00
commit ef17515623
2 changed files with 21 additions and 14 deletions

View File

@ -10,7 +10,7 @@ COPY static ./static
COPY requirements.txt main.py ./
RUN apt update
# Install supervisords
# Install supervisord
RUN apt install -y supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY config/cmd.sh /cmd.sh

View File

@ -239,6 +239,7 @@ def app_exits_in_docker(app_id):
flag = False
info = ""
cmd = "docker compose ls -a | grep \'/" + app_name + "/\'"
try:
output = shell_execute.execute_command_output_all(cmd)
if int(output["code"]) == 0:
info = output["result"]
@ -250,7 +251,10 @@ def app_exits_in_docker(app_id):
flag = True
elif app_name == customer_name:
flag = True
myLogger.info_logger("APP info: " + info)
myLogger.info_logger("APP in docker")
except CommandException as ce:
myLogger.info_logger("APP not in docker")
return info, flag
def split_app_id(app_id):
@ -362,12 +366,15 @@ def check_app_rq(app_id):
myLogger.info_logger(run_job_ids)
myLogger.info_logger(failed_job_ids)
if queue_job_ids and app_id in queue_job_ids:
myLogger.info_logger("App in RQ")
return True
if failed_job_ids and app_id in failed_job_ids:
myLogger.info_logger("App in RQ")
return True
if run_job_ids and app_id in run_job_ids:
myLogger.info_logger("App in RQ")
return True
myLogger.info_logger("App not in RQ")
return False
def get_apps_from_queue():