Skip to content

Commit

Permalink
fix: if destroy lock set destroy lock on start - destroy locks after …
Browse files Browse the repository at this point in the history
…starting listening
  • Loading branch information
SerhiyGreench committed May 3, 2022
1 parent 8af25ae commit b764f1a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/PgIpLock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ export class PgIpLock implements AnyLock {
await this.createSchema();
await Promise.all([this.createLock(), this.createDeadlockCheck()]);

// istanbul ignore if
if (DESTROY_LOCK_ON_START) {
await destroyLock();
}

if (this.notifyHandler) {
this.options.pgClient.on('notification', this.notifyHandler);
}
Expand All @@ -131,6 +126,11 @@ export class PgIpLock implements AnyLock {
async () => !this.acquired && this.acquire(),
this.options.acquireInterval,
));

// istanbul ignore if
if (DESTROY_LOCK_ON_START) {
await destroyLock();
}
}

/**
Expand Down

0 comments on commit b764f1a

Please sign in to comment.