expose locking provider in the server container
This commit is contained in:
parent
2c86cc821c
commit
cdf7f91259
|
@ -43,6 +43,7 @@ use OC\Command\AsyncBus;
|
|||
use OC\Diagnostics\NullQueryLogger;
|
||||
use OC\Diagnostics\EventLogger;
|
||||
use OC\Diagnostics\QueryLogger;
|
||||
use OC\Lock\MemcacheLockingProvider;
|
||||
use OC\Mail\Mailer;
|
||||
use OC\Memcache\ArrayCache;
|
||||
use OC\Http\Client\ClientService;
|
||||
|
@ -420,6 +421,13 @@ class Server extends SimpleContainer implements IServerContainer {
|
|||
$this->getLogger()
|
||||
);
|
||||
});
|
||||
$this->registerService('LockingProvider', function (Server $c) {
|
||||
/** @var \OC\Memcache\Factory $memcacheFactory */
|
||||
$memcacheFactory = $c->getMemCacheFactory();
|
||||
return new MemcacheLockingProvider(
|
||||
$memcacheFactory->createDistributed('lock')
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -908,4 +916,14 @@ class Server extends SimpleContainer implements IServerContainer {
|
|||
public function getTrustedDomainHelper() {
|
||||
return $this->query('TrustedDomainHelper');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the locking provider
|
||||
*
|
||||
* @return \OCP\Lock\ILockingProvider
|
||||
* @since 8.1.0
|
||||
*/
|
||||
public function getLockingProvider() {
|
||||
return $this->query('LockingProvider');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -413,4 +413,12 @@ interface IServerContainer {
|
|||
* @since 8.1.0
|
||||
*/
|
||||
public function getMailer();
|
||||
|
||||
/**
|
||||
* Get the locking provider
|
||||
*
|
||||
* @return \OCP\Lock\ILockingProvider
|
||||
* @since 8.1.0
|
||||
*/
|
||||
public function getLockingProvider();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue