repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e64c6fa
)
refactor: cleanup async lock acquire()
author
Jérôme Benoit
<jerome.benoit@sap.com>
Mon, 29 May 2023 12:44:23 +0000
(14:44 +0200)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Mon, 29 May 2023 12:44:23 +0000
(14:44 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/AsyncLock.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils/AsyncLock.ts
b/src/utils/AsyncLock.ts
index 229086fef1e8d2b45b9ae8f39ca77b867af0e2d5..cf0443b29c30268e0326ec5c2c8134b4bc284315 100644
(file)
--- a/
src/utils/AsyncLock.ts
+++ b/
src/utils/AsyncLock.ts
@@
-19,11
+19,11
@@
export class AsyncLock {
const asyncLock = AsyncLock.getAsyncLock(type);
if (!asyncLock.acquired) {
asyncLock.acquired = true;
- } else {
- return new Promise((resolve) => {
- asyncLock.resolveQueue.push(resolve);
- });
+ return;
}
+ return new Promise((resolve) => {
+ asyncLock.resolveQueue.push(resolve);
+ });
}
public static async release(type: AsyncLockType): Promise<void> {