perf(parsing): remove unsupported worker queue limit

This commit is contained in:
mesalogo
2026-10-07 16:15:28 +08:00
parent 4c25e85b08
commit 904bb691b8
3 changed files with 7 additions and 8 deletions
+2 -7
View File
@@ -47,7 +47,6 @@ type Task = {
cleanup: () => void
}
const MAX_QUEUED = 32
const RESTART_BACKOFF_MS = 30_000
type PdfExceptionConstructor = new (message: string) => Error
@@ -116,10 +115,9 @@ export class DocumentParseWorkerClient {
private readonly now: () => number = Date.now
) {}
/** False while closed, backing off after a crash, or when the queue is full. */
/** False while closed or backing off after a worker failure. */
get available(): boolean {
return !this.closed && this.now() >= this.disabledUntil &&
this.queue.length < MAX_QUEUED
return !this.closed && this.now() >= this.disabledUntil
}
get pendingCount(): number {
@@ -137,9 +135,6 @@ export class DocumentParseWorkerClient {
if (this.now() < this.disabledUntil) {
return Promise.reject(new DocumentParseWorkerUnavailableError('Document parse worker is backing off'))
}
if (this.queue.length >= MAX_QUEUED) {
return Promise.reject(new DocumentParseWorkerUnavailableError('Document parse worker is busy'))
}
return new Promise<T>((resolve, reject) => {
const task: Task = {
id: ++this.nextId,