repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: add more sanity checks to charging profiles handling code
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
AsyncLock.ts
diff --git
a/src/utils/AsyncLock.ts
b/src/utils/AsyncLock.ts
index 16ad4f2b1cdcf53b44a90f6b6970858cff789e28..9c0584565e3ecb80897b2ad32418a1afdb0cc888 100644
(file)
--- a/
src/utils/AsyncLock.ts
+++ b/
src/utils/AsyncLock.ts
@@
-25,7
+25,7
@@
export class AsyncLock {
asyncLock.acquired = true;
return;
}
asyncLock.acquired = true;
return;
}
- return new Promise((resolve) => {
+ return new Promise
<void>
((resolve) => {
asyncLock.resolveQueue.enqueue(resolve);
});
}
asyncLock.resolveQueue.enqueue(resolve);
});
}
@@
-36,8
+36,8
@@
export class AsyncLock {
asyncLock.acquired = false;
return;
}
asyncLock.acquired = false;
return;
}
- const queuedResolve = asyncLock.resolveQueue.dequeue();
- return new Promise((resolve) => {
+ const queuedResolve = asyncLock.resolveQueue.dequeue()
!
;
+ return new Promise
<void>
((resolve) => {
queuedResolve();
resolve();
});
queuedResolve();
resolve();
});
@@
-47,6
+47,6
@@
export class AsyncLock {
if (!AsyncLock.asyncLocks.has(type)) {
AsyncLock.asyncLocks.set(type, new AsyncLock());
}
if (!AsyncLock.asyncLocks.has(type)) {
AsyncLock.asyncLocks.set(type, new AsyncLock());
}
- return AsyncLock.asyncLocks.get(type);
+ return AsyncLock.asyncLocks.get(type)
!
;
}
}
}
}