mirror of
https://github.com/unraid/api.git
synced 2026-01-02 22:50:02 -06:00
fix: uncaught synchronous exception in AsyncMutex
This commit is contained in:
@@ -137,8 +137,7 @@ export class AsyncMutex<T = unknown> {
|
||||
}
|
||||
|
||||
const op = (operation || this.defaultOperation) as AsyncOperation<U | T>;
|
||||
|
||||
const promise = op().finally(() => {
|
||||
const promise = Promise.resolve().then(op).finally(() => {
|
||||
if (this.currentOperation === promise) {
|
||||
this.currentOperation = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user