|
|
|
@ -19,6 +19,7 @@ use OCP\IAppConfig; |
|
|
|
|
use OCP\IUser; |
|
|
|
|
use OCP\IUserManager; |
|
|
|
|
use OCP\Lock\ILockingProvider; |
|
|
|
|
use OCP\Lock\LockedException; |
|
|
|
|
use Psr\Log\LoggerInterface; |
|
|
|
|
|
|
|
|
|
class ExpireTrash extends TimedJob { |
|
|
|
@ -111,7 +112,7 @@ class ExpireTrash extends TimedJob { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private function resetOffset() { |
|
|
|
|
$this->runMutexOperation(function () { |
|
|
|
|
$this->runMutexOperation(function (): void { |
|
|
|
|
$this->appConfig->setValueInt(Application::APP_ID, self::OFFSET_CONFIG_KEY_NAME, 0); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -123,7 +124,7 @@ class ExpireTrash extends TimedJob { |
|
|
|
|
try { |
|
|
|
|
$this->lockingProvider->acquireLock(self::OFFSET_CONFIG_KEY_NAME, ILockingProvider::LOCK_EXCLUSIVE, 'Expire trashbin background job offset'); |
|
|
|
|
$acquired = true; |
|
|
|
|
} catch (\OCP\Lock\LockedException $e) { |
|
|
|
|
} catch (LockedException $e) { |
|
|
|
|
// wait a bit and try again |
|
|
|
|
usleep(100000); |
|
|
|
|
} |
|
|
|
|