mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Add proactive token refresh lead times for providers and implement Codex proxy management
This commit is contained in:
+3
-4
@@ -40,8 +40,8 @@ const MITM_PORT = 443;
|
||||
const MITM_WIN_NODE_PORT = 8443;
|
||||
const PID_FILE = path.join(MITM_DIR, ".mitm.pid");
|
||||
|
||||
const MITM_MAX_RESTARTS = 2;
|
||||
const MITM_RESTART_DELAYS_MS = [5000, 10000];
|
||||
const MITM_MAX_RESTARTS = 5;
|
||||
const MITM_RESTART_DELAYS_MS = [5000, 10000, 20000, 30000, 60000];
|
||||
const MITM_RESTART_RESET_MS = 60000;
|
||||
|
||||
let mitmRestartCount = 0;
|
||||
@@ -323,8 +323,7 @@ async function scheduleMitmRestart(apiKey) {
|
||||
if (aliveMs >= MITM_RESTART_RESET_MS) mitmRestartCount = 0;
|
||||
|
||||
if (mitmRestartCount >= MITM_MAX_RESTARTS) {
|
||||
err("Max restart attempts reached. Auto-disabling MITM.");
|
||||
await saveMitmSettings(false, null);
|
||||
err("Max restart attempts reached. Giving up.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user