mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
Rename and remove redundant logic
This commit is contained in:
@@ -67,12 +67,10 @@ class SimpleFunctionQueue {
|
||||
return;
|
||||
}
|
||||
this.#queue.push(config);
|
||||
if (!this.#running) {
|
||||
this.#runNext();
|
||||
}
|
||||
this.#tryRunNext();
|
||||
}
|
||||
|
||||
async #runNext() {
|
||||
async #tryRunNext() {
|
||||
if (this.#running || !this.#queue.length) return;
|
||||
try {
|
||||
const { signal, callback } = this.#queue.shift();
|
||||
@@ -85,7 +83,7 @@ class SimpleFunctionQueue {
|
||||
error(`${this.#id} Queue:`, err);
|
||||
} finally {
|
||||
this.#running = false;
|
||||
this.#runNext();
|
||||
this.#tryRunNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user