Skip to content

Commit

Permalink
fixup! Add public API for owner based locking
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr committed Mar 23, 2022
1 parent 9763d93 commit ee66ba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/private/Files/Lock/LockManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function isLockProviderAvailable(): bool {

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

if ($this->lockInScope) {
Expand Down
5 changes: 4 additions & 1 deletion lib/public/Files/Lock/ILockManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public function registerLockProvider(ILockProvider $lockProvider): void;
public function isLockProviderAvailable(): bool;

/**
* @throws NoLockProviderException if there is no lock provider available
* Run within the scope of a given lock condition
*
* The callback will also be executed if no lock provider is present
*
* @since 24.0.0
*/
public function runInScope(LockScope $lock, callable $callback): void;
Expand Down

0 comments on commit ee66ba6

Please sign in to comment.