Raise Nginx proxy timeouts so AI daily/weekly review is not cut at 60s.

POST /ai_daily_review was returning 504 while the model was still running; patch BT reverse-proxy read/send timeouts to 360s on deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-17 13:12:32 +08:00
parent 5bd3f3250a
commit af7fb44650
4 changed files with 108 additions and 4 deletions
@@ -336,7 +336,9 @@ function genDaily(){
const ac = new AbortController();
const timer = setTimeout(()=>ac.abort(), 360000);
fetch("/ai_daily_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`date=${encodeURIComponent(d)}`,signal:ac.signal})
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
.then(r=>{ if(!r.ok) throw new Error(r.status === 504
? "HTTP 504(网关超时:Nginx 等反代切断,通常 AI 仍在生成;已加长超时后请重试)"
: ("HTTP "+r.status)); return r.json(); })
.then(data=>{
if(!data || data.result == null) throw new Error("返回数据为空");
const el=document.getElementById("daily_result");
@@ -379,7 +381,9 @@ function genWeekly(){
const ac = new AbortController();
const timer = setTimeout(()=>ac.abort(), 360000);
fetch("/ai_weekly_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`start_date=${encodeURIComponent(s)}&end_date=${encodeURIComponent(e)}`,signal:ac.signal})
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
.then(r=>{ if(!r.ok) throw new Error(r.status === 504
? "HTTP 504(网关超时:Nginx 等反代切断,通常 AI 仍在生成;已加长超时后请重试)"
: ("HTTP "+r.status)); return r.json(); })
.then(data=>{
if(!data || data.result == null) throw new Error("返回数据为空");
const el=document.getElementById("weekly_result");
+6 -2
View File
@@ -796,7 +796,9 @@ function genDaily(){
const ac = new AbortController();
const timer = setTimeout(()=>ac.abort(), 360000);
fetch("/ai_daily_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`date=${encodeURIComponent(d)}`,signal:ac.signal})
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
.then(r=>{ if(!r.ok) throw new Error(r.status === 504
? "HTTP 504(网关超时:Nginx 等反代切断,通常 AI 仍在生成;已加长超时后请重试)"
: ("HTTP "+r.status)); return r.json(); })
.then(data=>{
if(!data || data.result == null) throw new Error("返回数据为空");
const el=document.getElementById("daily_result");
@@ -839,7 +841,9 @@ function genWeekly(){
const ac = new AbortController();
const timer = setTimeout(()=>ac.abort(), 360000);
fetch("/ai_weekly_review",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`start_date=${encodeURIComponent(s)}&end_date=${encodeURIComponent(e)}`,signal:ac.signal})
.then(r=>{ if(!r.ok) throw new Error("HTTP "+r.status); return r.json(); })
.then(r=>{ if(!r.ok) throw new Error(r.status === 504
? "HTTP 504(网关超时:Nginx 等反代切断,通常 AI 仍在生成;已加长超时后请重试)"
: ("HTTP "+r.status)); return r.json(); })
.then(data=>{
if(!data || data.result == null) throw new Error("返回数据为空");
const el=document.getElementById("weekly_result");