Allow canvas image queue concurrency up to 100
This commit is contained in:
parent
432d315bc6
commit
9f17020582
@ -19,13 +19,14 @@ interface QueueState {
|
||||
}
|
||||
|
||||
const DEFAULT_CONCURRENCY = 1;
|
||||
const MAX_CONCURRENCY = 100;
|
||||
const STALE_RUNNING_MS = 5 * 60 * 1000;
|
||||
const queueStateKey = "__canvas_image_task_queue_state__";
|
||||
|
||||
function getQueueConcurrency(): number {
|
||||
const raw = Number.parseInt(process.env.CANVAS_IMAGE_TASK_CONCURRENCY || "", 10);
|
||||
if (Number.isFinite(raw) && raw > 0) {
|
||||
return Math.min(raw, 4);
|
||||
return Math.min(raw, MAX_CONCURRENCY);
|
||||
}
|
||||
return DEFAULT_CONCURRENCY;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user