mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 21:32:10 +03:00
fix(api-bridge): make proxy timeout configurable via env
This commit is contained in:
@@ -166,6 +166,8 @@ GEMINI_CLI_USER_AGENT=google-api-nodejs-client/9.15.1
|
||||
# Timeout settings
|
||||
# FETCH_TIMEOUT_MS=120000
|
||||
# STREAM_IDLE_TIMEOUT_MS=60000
|
||||
# API bridge timeout for /v1 proxy requests (default: 30000)
|
||||
# API_BRIDGE_PROXY_TIMEOUT_MS=120000
|
||||
|
||||
# CORS configuration (default: * allows all origins)
|
||||
# CORS_ORIGINS=*
|
||||
|
||||
@@ -2,7 +2,7 @@ import http from "node:http";
|
||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||
import { getRuntimePorts } from "@/lib/runtime/ports";
|
||||
|
||||
const PROXY_TIMEOUT_MS = 30_000; // 30s timeout to prevent resource exhaustion
|
||||
const PROXY_TIMEOUT_MS = Number(process.env.API_BRIDGE_PROXY_TIMEOUT_MS || "30000");
|
||||
|
||||
const OPENAI_COMPAT_PATHS = [
|
||||
/^\/v1(?:\/|$)/,
|
||||
|
||||
Reference in New Issue
Block a user