mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 15:40:22 +00:00
container exception
This commit is contained in:
parent
0b2130fc36
commit
12d0c283a7
2 changed files with 13 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -146,11 +146,19 @@ def delete_app(app_id):
|
|||
lib_path = '/data/library/apps/' + app_name
|
||||
if app_path != lib_path:
|
||||
cmd = cmd + " && sudo rm -rf " + app_path
|
||||
shell_execute.execute_command_output_all(cmd)
|
||||
|
||||
try:
|
||||
myLogger.info_logger("Intall fail, down app and delete files")
|
||||
shell_execute.execute_command_output_all(cmd)
|
||||
except Exception:
|
||||
myLogger.info_logger("Delete app compose exception")
|
||||
# 强制删除失败又无法通过docker compose down 删除的容器
|
||||
force_cmd = "docker rm -f $(docker ps -f name=^"+customer_name+" -aq)"
|
||||
shell_execute.execute_command_output_all(force_cmd)
|
||||
try:
|
||||
myLogger.info_logger("IF delete fail, force to delete containers")
|
||||
force_cmd = "docker rm -f $(docker ps -f name=^"+customer_name+" -aq)"
|
||||
shell_execute.execute_command_output_all(force_cmd)
|
||||
except Exception:
|
||||
myLogger.info_logger("force delete app compose exception")
|
||||
|
||||
else:
|
||||
if check_app_rq(app_id):
|
||||
delete_app_failedjob(app_id)
|
||||
|
|
Loading…
Reference in a new issue