Skip to content

Commit 1e0b1ed

Browse files
authored
feat: make maxDuration configurable via MAX_DURATION env (#120)
1 parent 1d03d10 commit 1e0b1ed

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/api/chat/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "@/lib/langfuse"
1616
import { getSystemPrompt } from "@/lib/system-prompts"
1717

18-
export const maxDuration = 300
18+
export const maxDuration = Number(process.env.MAX_DURATION) || 60
1919

2020
// File upload limits (must match client-side)
2121
const MAX_FILE_SIZE = 2 * 1024 * 1024 // 2MB

env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ AI_MODEL=global.anthropic.claude-sonnet-4-5-20250929-v1:0
5050

5151
# Access Control (Optional)
5252
# ACCESS_CODE_LIST=your-secret-code,another-code
53+
54+
# API Route Configuration (Optional)
55+
# MAX_DURATION=60 # Max duration in seconds for API routes (default: 60)

0 commit comments

Comments
 (0)