mirror of
https://github.com/unraid/api.git
synced 2026-01-07 00:59:48 -06:00
rm redundant executeOperation function
This commit is contained in:
@@ -55,7 +55,7 @@ export class AsyncMutex<T = unknown> {
|
||||
|
||||
const op = (operation || this.defaultOperation) as AsyncOperation<U | T>;
|
||||
|
||||
const promise = this.executeOperation(op).finally(() => {
|
||||
const promise = op().finally(() => {
|
||||
if (this.currentOperation === promise) {
|
||||
this.currentOperation = null;
|
||||
}
|
||||
@@ -64,8 +64,4 @@ export class AsyncMutex<T = unknown> {
|
||||
this.currentOperation = promise;
|
||||
return promise;
|
||||
}
|
||||
|
||||
private async executeOperation<U>(operation: AsyncOperation<U>): Promise<U> {
|
||||
return operation();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user