Skip to content

Commit f4bfa6c

Browse files
committed
Rewrite logic to two keyed lock
1 parent f9a67a8 commit f4bfa6c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ $isLockAcquired = $postgresLocker->acquireLock(
4040
$dbConnection,
4141
$postgresLockId,
4242
\Cog\DbLocker\Locker\PostgresAdvisoryLockScopeEnum::Transaction,
43+
\Cog\DbLocker\Locker\PostgresAdvisoryLockTypeEnum::NonBlocking,
44+
\Cog\DbLocker\Locker\PostgresLockModeEnum::Exclusive,
4345
);
4446
if ($isLockAcquired) {
4547
// Execute logic if lock was successful
@@ -61,6 +63,8 @@ $isLockAcquired = $postgresLocker->acquireLock(
6163
$dbConnection,
6264
$postgresLockId,
6365
\Cog\DbLocker\Locker\PostgresAdvisoryLockScopeEnum::Session,
66+
\Cog\DbLocker\Locker\PostgresAdvisoryLockTypeEnum::NonBlocking,
67+
\Cog\DbLocker\Locker\PostgresLockModeEnum::Exclusive,
6468
);
6569
if ($isLockAcquired) {
6670
// Execute logic if lock was successful

0 commit comments

Comments
 (0)