Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/app/api/jobs/[jobId]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export async function GET(
}

if (job.status === JOB_STATUS.PROCESSING || job.status === JOB_STATUS.PENDING) {
response.estimatedDuration = 180000
response.estimatedDuration = 300000
}

return NextResponse.json(response)
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/lib/knowledge/documents/document-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { mistralParserTool } from '@/tools/mistral/parser'
const logger = createLogger('DocumentProcessor')

const TIMEOUTS = {
FILE_DOWNLOAD: 180000,
FILE_DOWNLOAD: 600000,
MISTRAL_OCR_API: 120000,
} as const

Expand Down
6 changes: 5 additions & 1 deletion apps/sim/lib/uploads/utils/file-utils.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use server'

import type { Logger } from '@sim/logger'
import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
import {
secureFetchWithPinnedIP,
validateUrlWithDNS,
Expand Down Expand Up @@ -135,7 +136,10 @@ export async function resolveFileInputToUrl(
* For internal URLs, uses direct storage access (server-side only)
* For external URLs, validates DNS/SSRF and uses secure fetch with IP pinning
*/
export async function downloadFileFromUrl(fileUrl: string, timeoutMs = 180000): Promise<Buffer> {
export async function downloadFileFromUrl(
fileUrl: string,
timeoutMs = getMaxExecutionTimeout()
): Promise<Buffer> {
const { parseInternalFileUrl } = await import('./file-utils')

if (isInternalFileUrl(fileUrl)) {
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/lib/uploads/utils/user-file-base64.server.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type { Logger } from '@sim/logger'
import { createLogger } from '@sim/logger'
import { getRedisClient } from '@/lib/core/config/redis'
import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
import { isUserFileWithMetadata } from '@/lib/core/utils/user-file'
import { bufferToBase64 } from '@/lib/uploads/utils/file-utils'
import { downloadFileFromStorage, downloadFileFromUrl } from '@/lib/uploads/utils/file-utils.server'
import type { UserFile } from '@/executor/types'

const DEFAULT_MAX_BASE64_BYTES = 10 * 1024 * 1024
const DEFAULT_TIMEOUT_MS = 180000
const DEFAULT_TIMEOUT_MS = getMaxExecutionTimeout()
const DEFAULT_CACHE_TTL_SECONDS = 300
const REDIS_KEY_PREFIX = 'user-file:base64:'

Expand Down