File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export async function GET(
7676 }
7777
7878 if ( job . status === JOB_STATUS . PROCESSING || job . status === JOB_STATUS . PENDING ) {
79- response . estimatedDuration = 180000
79+ response . estimatedDuration = 300000
8080 }
8181
8282 return NextResponse . json ( response )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { mistralParserTool } from '@/tools/mistral/parser'
1414const logger = createLogger ( 'DocumentProcessor' )
1515
1616const TIMEOUTS = {
17- FILE_DOWNLOAD : 180000 ,
17+ FILE_DOWNLOAD : 600000 ,
1818 MISTRAL_OCR_API : 120000 ,
1919} as const
2020
Original file line number Diff line number Diff line change 11'use server'
22
33import type { Logger } from '@sim/logger'
4+ import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
45import {
56 secureFetchWithPinnedIP ,
67 validateUrlWithDNS ,
@@ -135,7 +136,10 @@ export async function resolveFileInputToUrl(
135136 * For internal URLs, uses direct storage access (server-side only)
136137 * For external URLs, validates DNS/SSRF and uses secure fetch with IP pinning
137138 */
138- export async function downloadFileFromUrl ( fileUrl : string , timeoutMs = 180000 ) : Promise < Buffer > {
139+ export async function downloadFileFromUrl (
140+ fileUrl : string ,
141+ timeoutMs = getMaxExecutionTimeout ( )
142+ ) : Promise < Buffer > {
139143 const { parseInternalFileUrl } = await import ( './file-utils' )
140144
141145 if ( isInternalFileUrl ( fileUrl ) ) {
Original file line number Diff line number Diff line change 11import type { Logger } from '@sim/logger'
22import { createLogger } from '@sim/logger'
33import { getRedisClient } from '@/lib/core/config/redis'
4+ import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
45import { isUserFileWithMetadata } from '@/lib/core/utils/user-file'
56import { bufferToBase64 } from '@/lib/uploads/utils/file-utils'
67import { downloadFileFromStorage , downloadFileFromUrl } from '@/lib/uploads/utils/file-utils.server'
78import type { UserFile } from '@/executor/types'
89
910const DEFAULT_MAX_BASE64_BYTES = 10 * 1024 * 1024
10- const DEFAULT_TIMEOUT_MS = 180000
11+ const DEFAULT_TIMEOUT_MS = getMaxExecutionTimeout ( )
1112const DEFAULT_CACHE_TTL_SECONDS = 300
1213const REDIS_KEY_PREFIX = 'user-file:base64:'
1314
You can’t perform that action at this time.
0 commit comments