Merge remote-tracking branch 'origin/main'

This commit is contained in:
TooY 2023-04-17 09:20:05 +08:00
commit 07f6982c05
2 changed files with 8 additions and 10 deletions

View File

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

View File

@ -138,8 +138,8 @@ def restart_app(app_id):
def delete_app_failedjob(job_id):
myLogger.info_logger("delete_app_failedjob")
fail_job = q.fetch_job(job_id)
fail_job.delete()
failed = FailedJobRegistry(queue=q)
failed.remove(job_id, delete_job=True)
def uninstall_app(app_id):
code, message = docker.check_app_id(app_id)
@ -407,25 +407,23 @@ def get_apps_from_queue():
installing_list = []
for job_id in run_job_ids:
app = get_installing_app(job_id, 'installing', "", "", "")
app = get_rq_app(job_id, 'installing', "", "", "")
installing_list.append(app)
for job in q.jobs:
app = get_installing_app(job.id, 'installing', "", "", "")
app = get_rq_app(job.id, 'installing', "", "", "")
installing_list.append(app)
for job_id in failed_jobs:
job = q.fetch_job(job_id)
app = get_installing_app(job_id, 'failed', "", "", "")
app = get_rq_app(job_id, 'failed', "", "", "")
installing_list.append(app)
return installing_list
def get_installing_app(id, status, code, message, detail):
def get_rq_app(id, status, code, message, detail):
app_name = id.split('_')[0]
customer_name = id.split('_')[1]
# 当app还在RQ时可能文件夹还没创建无法获取trade_mark
trade_mark = ""
if status == "installing":
var_path = "/data/apps/" + customer_name + "/variables.json"
trade_mark = docker.read_var(var_path, 'trademark')
image_url = get_Image_url(app_name)
running_info = RunningInfo(port=0, compose_file="", url="", admin_url="",