修复商品风险多店铺问题
This commit is contained in:
4
app/.env
4
app/.env
@@ -11,8 +11,8 @@ zn_username=%E8%87%AA%E5%8A%A8%E5%8C%96_Robot
|
||||
client_name=ShuFuAI
|
||||
|
||||
|
||||
java_api_base=http://47.111.163.154:18080
|
||||
# java_api_base=http://127.0.0.1:18080
|
||||
# java_api_base=http://47.111.163.154:18080
|
||||
java_api_base=http://127.0.0.1:18080
|
||||
# java_api_base=http://8.136.19.173:18080
|
||||
|
||||
|
||||
|
||||
@@ -195,10 +195,13 @@ def proxy(path):
|
||||
if key.lower() in ['host', 'content-length', 'connection']:
|
||||
continue
|
||||
headers[key] = value
|
||||
ignore_url = [f"{JAVA_API_BASE}/api/delete-brand/tasks/batch",
|
||||
f"{JAVA_API_BASE}/api/delete-brand/history",
|
||||
f"{JAVA_API_BASE}/api/product-risk-resolve/tasks/batch",
|
||||
]
|
||||
ignore_url = [f"{JAVA_API_BASE}/api/delete-brand/tasks/batch",
|
||||
f"{JAVA_API_BASE}/api/delete-brand/tasks/progress/batch",
|
||||
f"{JAVA_API_BASE}/api/delete-brand/history",
|
||||
f"{JAVA_API_BASE}/api/product-risk-resolve/tasks/batch",
|
||||
f"{JAVA_API_BASE}/api/product-risk-resolve/tasks/progress/batch",
|
||||
]
|
||||
proxy_timeout = 180 if target_url.endswith("/api/delete-brand/run") else 30
|
||||
if target_url not in ignore_url:
|
||||
try:
|
||||
print("=============================")
|
||||
@@ -219,7 +222,7 @@ def proxy(path):
|
||||
data=request.get_data() if request.get_data() else None,
|
||||
cookies=request.cookies,
|
||||
stream=True, # 启用流式传输
|
||||
timeout=30
|
||||
timeout=proxy_timeout
|
||||
)
|
||||
|
||||
# 流式响应
|
||||
|
||||
Reference in New Issue
Block a user