perf(parsing): remove unsupported worker queue limit
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user