mirror of
https://github.com/karakeep-app/karakeep.git
synced 2025-12-12 20:35:52 +01:00
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:
@@ -62,7 +62,7 @@ export class AssetPreprocessingWorker {
|
||||
{
|
||||
concurrency: serverConfig.assetPreprocessing.numWorkers,
|
||||
pollIntervalMs: 1000,
|
||||
timeoutSecs: 30,
|
||||
timeoutSecs: serverConfig.assetPreprocessing.jobTimeoutSec,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user