Skip to content

Commit f3bbadb

Browse files
author
waleed
committed
increase timeouts to match trigger
1 parent 9f1b9fe commit f3bbadb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

apps/sim/background/knowledge-processing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type DocumentProcessingPayload = {
2626

2727
export const processDocument = task({
2828
id: 'knowledge-process-document',
29-
maxDuration: env.KB_CONFIG_MAX_DURATION || 300,
29+
maxDuration: env.KB_CONFIG_MAX_DURATION || 600,
3030
retry: {
3131
maxAttempts: env.KB_CONFIG_MAX_ATTEMPTS || 3,
3232
factor: env.KB_CONFIG_RETRY_FACTOR || 2,

apps/sim/lib/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const env = createEnv({
146146
RATE_LIMIT_ENTERPRISE_ASYNC: z.string().optional().default('1000'), // Enterprise tier async API executions per minute
147147

148148
// Knowledge Base Processing Configuration - Shared across all processing methods
149-
KB_CONFIG_MAX_DURATION: z.number().optional().default(300), // Max processing duration in s
149+
KB_CONFIG_MAX_DURATION: z.number().optional().default(600), // Max processing duration in seconds (10 minutes)
150150
KB_CONFIG_MAX_ATTEMPTS: z.number().optional().default(3), // Max retry attempts
151151
KB_CONFIG_RETRY_FACTOR: z.number().optional().default(2), // Retry backoff factor
152152
KB_CONFIG_MIN_TIMEOUT: z.number().optional().default(1000), // Min timeout in ms

apps/sim/lib/knowledge/documents/service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import type { DocumentSortField, SortOrder } from './types'
1717
const logger = createLogger('DocumentService')
1818

1919
const TIMEOUTS = {
20-
OVERALL_PROCESSING: (env.KB_CONFIG_MAX_DURATION || 600) * 1000, // Increased to 10 minutes to match Trigger's timeout
20+
OVERALL_PROCESSING: (env.KB_CONFIG_MAX_DURATION || 600) * 1000, // Default 10 minutes for KB document processing
2121
EMBEDDINGS_API: (env.KB_CONFIG_MAX_TIMEOUT || 10000) * 18,
2222
} as const
2323

2424
// Configuration for handling large documents
2525
const LARGE_DOC_CONFIG = {
2626
MAX_CHUNKS_PER_BATCH: 500, // Insert embeddings in batches of 500
27-
MAX_EMBEDDING_BATCH: 50, // Generate embeddings in batches of 50
27+
MAX_EMBEDDING_BATCH: 500, // Generate embeddings in batches of 500
2828
MAX_FILE_SIZE: 100 * 1024 * 1024, // 100MB max file size
2929
MAX_CHUNKS_PER_DOCUMENT: 100000, // Maximum chunks allowed per document
3030
}

0 commit comments

Comments
 (0)