Skip to content

Commit

Permalink
0.9.8.15
Browse files Browse the repository at this point in the history
#####
1. 修复脚本
2. 修复端口检查

#####
  • Loading branch information
Xingsandesu committed Jan 19, 2024
1 parent a3c5f67 commit 443764d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .shell/get-taichi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ EOF
unzip /usr/taichi/master -d /usr/taichi
echo "文件下载并解压完成"
echo "解压Python源码"
tar -zvxf /usr/taichi/TaiChi_OS-master/.shell/Python-3.11.7.tgz
tar -zvxf /usr/taichi/TaiChi_OS-master/.shell/Python-3.11.7.tgz -C /usr/taichi/TaiChi_OS-master/.shell/Python-3.11.7
echo "编译安装Python"
cd /usr/taichi/TaiChi_OS-master/.shell/Python-3.11.7
echo "Python源码lto优化"
Expand Down
15 changes: 5 additions & 10 deletions async_app/http.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import logging
import os
import socket
from subprocess import run

import tornado.httpclient
Expand Down Expand Up @@ -32,6 +33,9 @@ def create_api_response(handler: tornado.web.RequestHandler, code: int, errmsg:

handler.set_header("Content-Type", "application/json; charset=utf-8")
handler.write(json_data)





class CreateContainerHandler(tornado.web.RequestHandler):
Expand Down Expand Up @@ -63,16 +67,7 @@ async def post(self, id):
logging.info(f"Ports: {ports}")
logging.info(f"Restart Policy: {restart_policy}")
logging.info(f"Environment Variables: {env}") # 打印环境变量

try:
if client.containers.list(filters={'expose': list(ports.keys())}):
logging.error(f"端口{ports}已被占用")
return create_api_response(self, CODE_NO, f"端口{ports}已被占用")

except Exception as e:
logging.error(f"检查端口占用时出错: {e}")
return create_api_response(self, CODE_NO, f"检查端口占用时出错: {e}")


volumes = app_run_data.get('volumes', {})
for volume, details in volumes.items():
if volume not in [v.name for v in client.volumes.list()]:
Expand Down

0 comments on commit 443764d

Please sign in to comment.