Skip to content

Commit ee66ba6

Browse files
committed
fixup! Add public API for owner based locking
1 parent 9763d93 commit ee66ba6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/private/Files/Lock/LockManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public function isLockProviderAvailable(): bool {
2626

2727
public function runInScope(LockScope $lock, callable $callback): void {
2828
if (!$this->lockProvider) {
29-
throw new PreConditionNotMetException('No lock provider available');
29+
$callback();
30+
return;
3031
}
3132

3233
if ($this->lockInScope) {

lib/public/Files/Lock/ILockManager.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ public function registerLockProvider(ILockProvider $lockProvider): void;
2222
public function isLockProviderAvailable(): bool;
2323

2424
/**
25-
* @throws NoLockProviderException if there is no lock provider available
25+
* Run within the scope of a given lock condition
26+
*
27+
* The callback will also be executed if no lock provider is present
28+
*
2629
* @since 24.0.0
2730
*/
2831
public function runInScope(LockScope $lock, callable $callback): void;

0 commit comments

Comments
 (0)