Allow canvas image queue concurrency up to 100
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-04-27 17:22:58 +08:00
parent 432d315bc6
commit 9f17020582

View File

@ -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;
}