feat: make asset preprocessing worker timeout configurable

- Added ASSET_PREPROCESSING_JOB_TIMEOUT_SEC environment variable with default of 60 seconds (increased from hardcoded 30 seconds)
- Updated worker to use the configurable timeout from serverConfig
- Added documentation for the new configuration option
This commit is contained in:
Claude
2025-12-09 22:54:55 +00:00
committed by Mohamed Bassem
parent 3e8cc745dd
commit 91784cd20c
3 changed files with 4 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ export class AssetPreprocessingWorker {
{
concurrency: serverConfig.assetPreprocessing.numWorkers,
pollIntervalMs: 1000,
timeoutSecs: 30,
timeoutSecs: serverConfig.assetPreprocessing.jobTimeoutSec,
},
);

View File

@@ -27,6 +27,7 @@ The app is mainly configured by environment variables. All the used environment
| SEARCH_JOB_TIMEOUT_SEC | No | 30 | How long to wait for a search indexing job to finish before timing out. Increase this if you have large bookmarks with extensive content that takes longer to index. |
| WEBHOOK_NUM_WORKERS | No | 1 | Number of concurrent workers for webhook delivery. Increase this if you have multiple webhook endpoints or high webhook traffic. |
| ASSET_PREPROCESSING_NUM_WORKERS | No | 1 | Number of concurrent workers for asset preprocessing tasks (image processing, OCR, etc.). Increase this if you have many images or documents that need processing. |
| ASSET_PREPROCESSING_JOB_TIMEOUT_SEC | No | 60 | How long to wait for an asset preprocessing job to finish before timing out. Increase this if you have large images or PDFs that take longer to process. |
| RULE_ENGINE_NUM_WORKERS | No | 1 | Number of concurrent workers for rule engine processing. Increase this if you have complex automation rules that need to be processed quickly. |
## Asset Storage

View File

@@ -93,6 +93,7 @@ const allEnv = z.object({
SEARCH_JOB_TIMEOUT_SEC: z.coerce.number().default(30),
WEBHOOK_NUM_WORKERS: z.coerce.number().default(1),
ASSET_PREPROCESSING_NUM_WORKERS: z.coerce.number().default(1),
ASSET_PREPROCESSING_JOB_TIMEOUT_SEC: z.coerce.number().default(60),
RULE_ENGINE_NUM_WORKERS: z.coerce.number().default(1),
CRAWLER_DOWNLOAD_BANNER_IMAGE: stringBool("true"),
CRAWLER_STORE_SCREENSHOT: stringBool("true"),
@@ -353,6 +354,7 @@ const serverConfigSchema = allEnv.transform((val, ctx) => {
allowedInternalHostnames: val.CRAWLER_ALLOWED_INTERNAL_HOSTNAMES,
assetPreprocessing: {
numWorkers: val.ASSET_PREPROCESSING_NUM_WORKERS,
jobTimeoutSec: val.ASSET_PREPROCESSING_JOB_TIMEOUT_SEC,
},
ruleEngine: {
numWorkers: val.RULE_ENGINE_NUM_WORKERS,