Skip to content

Commit 865e560

Browse files
committed
chore(deps): 升级依赖版本并优化ES客户端连接逻辑
- 升级部分包依赖 - 优化 logger 中的 ES 客户端初始化逻辑,支持多版本自动适配(es7,8,9) - 移除 eureka.py 中无用的 pass 语句 - 更新 README.md 中的 Docker 镜像标签至 v2.7.6
1 parent 4a87dc0 commit 865e560

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/backup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def check_file(file_path):
9292
with open(f"{config_dir}/{syncer['base_name']}", 'w') as f:
9393
try:
9494
resp = httpx.get(f"{syncer['syncer']}/gateway-api-to-file/{gateway}",
95-
headers={"SYNCER-API-KEY": f"{syncer['syncer_api_key']}"})
95+
headers={"SYNCER-API-KEY": f"{syncer['syncer_api_key']}"}, verify=False)
9696
status_code = resp.status_code
9797
syncer_err_msg = resp.headers.get("syncer-err-msg", None)
9898
if status_code == 200:
@@ -107,11 +107,11 @@ def check_file(file_path):
107107
print(
108108
f"\n\n下载 {syncer['syncer']}/gateway-api-to-file/{gateway}{config_dir}/{syncer['base_name']} ,status_code={status_code}, status_msg={status_msg}")
109109
script_file.write(f"""
110-
def restore_{job.replace("-","_")}_{gateway.replace("-","_")}():
110+
def restore_{job.replace("-", "_")}_{gateway.replace("-", "_")}():
111111
check_file("{job}/{gateway}/{syncer['base_name']}")
112112
with open("{job}/{gateway}/{syncer['base_name']}", 'r', encoding='UTF-8') as f:
113113
resp = httpx.put("{syncer['syncer']}/restore/{gateway}", content="\\n".join(f.readlines()),
114-
headers={{"SYNCER-API-KEY": "{syncer['syncer_api_key']}"}}).text
114+
headers={{"SYNCER-API-KEY": "{syncer['syncer_api_key']}"}}, verify=False).text
115115
print(f"还原 {job}/{gateway}/{syncer['base_name']}{syncer['syncer']}/restore/{gateway} , 结果为: {{resp}}")
116116
117117
""")
@@ -132,7 +132,7 @@ def restore_{job.replace("-","_")}_{gateway.replace("-","_")}():
132132
items = restore_job.split("_")
133133
script_file.write(f"""
134134
# 还原 {items[1]} 下的 {items[2]}
135-
# {restore_job.replace("-","_")}
135+
# {restore_job.replace("-", "_")}
136136
""")
137137

138138
print("执行 python restore.py 还原网关配置")
@@ -146,7 +146,7 @@ def restore_{job.replace("-","_")}_{gateway.replace("-","_")}():
146146
syncer_jobs = {
147147
"apisix1": {
148148
"syncer": "http://localhost:9797",
149-
"gateways": ["apisix1","apisix2"],
149+
"gateways": ["apisix1", "apisix2"],
150150
"base_name": "apisix.yaml",
151151
"syncer_api_key": "NopU13xRheZng2hqHAwaI0TF5VHNN05G"
152152
}

0 commit comments

Comments
 (0)