Commit f782c6fc authored by 金凯强's avatar 金凯强 🎨

..

parent 1f0e4658
......@@ -58,19 +58,19 @@ if __name__ == '__main__':
# print(res.json())
# # 获取app升级日志列表
# res = requests.get('http://localhost:5000/info/upgrade_log/')
# print(json.dumps(res.json(), indent=4))
#
#
# # 获取app单次升级日志明细
# res = requests.get('http://localhost:5000/info/upgrade_log_dtl/1238022723059486720/')
# print(json.dumps(res.json(), indent=4))
# 获取app升级日志列表
res = requests.get('http://localhost:5000/info/upgrade_log/')
print(json.dumps(res.json(), indent=4))
# 获取app单次升级日志明细
res = requests.get('http://localhost:5000/info/upgrade_log_dtl/1238022723059486720/')
print(json.dumps(res.json(), indent=4))
# 安装runner
# res = requests.get('http://localhost:5000/install/runner/')
# print(json.dumps(res.json(), indent=4))
# 回滚升级
res = requests.get('http://localhost:5000/upgrade/rollback/1238022723059486720/')
print(json.dumps(res.json(), indent=4))
\ No newline at end of file
# # 回滚升级
# res = requests.get('http://localhost:5000/upgrade/rollback/1238022723059486720/')
# print(json.dumps(res.json(), indent=4))
\ No newline at end of file
......@@ -82,6 +82,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
with db_driver as session:
# 对应的版本信息修改为当前版本
session.exec_sql(f'update app_upgrade_log set default_version=1 where id={log_id}')
session.exec_sql(f'update app_upgrade_log set default_version=0 where id<>{log_id}')
return {'err': err, "out": out}
# 注意异常情况下的处理
......
......@@ -92,6 +92,7 @@ class DBDriver:
def __exit__(self, exc_type, exc_val, exc_tb):
if exc_val:
self.conn.rollback()
raise exc_val
else:
self.conn.commit()
self.conn.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment