Skip to content

Commit 3a9b3b7

Browse files
committed
fix: cleanup
1 parent 41a95ad commit 3a9b3b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PgIpLock.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export class PgIpLock implements AnyLock {
124124
if (!this.uniqueKey) {
125125
await this.listen();
126126

127+
// noinspection TypeScriptValidateTypes
127128
!this.acquireTimer && (this.acquireTimer = setInterval(
128129
() => !this.acquired && this.acquire(),
129130
this.options.acquireInterval,
@@ -273,6 +274,7 @@ export class PgIpLock implements AnyLock {
273274
}
274275

275276
if (this.acquireTimer) {
277+
// noinspection TypeScriptValidateTypes
276278
clearInterval(this.acquireTimer);
277279
delete this.acquireTimer;
278280
}
@@ -478,10 +480,10 @@ async function destroyLock(): Promise<number> {
478480
return 0;
479481
} catch (err) {
480482
// istanbul ignore next
481-
(PgIpLock.hasInstances()
483+
((PgIpLock.hasInstances()
482484
? (PgIpLock as any).instances[0].options.logger
483485
: console
484-
).error(err);
486+
) as any)?.error(err);
485487

486488
return 1;
487489
}

0 commit comments

Comments
 (0)