summaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 581a2b44cea..2ce895c6f72 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -519,14 +519,17 @@ class Server extends ServerContainer implements IServerContainer {
);
});
$this->registerService('LockingProvider', function (Server $c) {
- if ($c->getConfig()->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
+ $ini = $c->getIniWrapper();
+ $config = $c->getConfig();
+ $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
+ if ($config->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
/** @var \OC\Memcache\Factory $memcacheFactory */
$memcacheFactory = $c->getMemCacheFactory();
$memcache = $memcacheFactory->createLocking('lock');
if (!($memcache instanceof \OC\Memcache\NullCache)) {
- return new MemcacheLockingProvider($memcache);
+ return new MemcacheLockingProvider($memcache, $ttl);
}
- return new DBLockingProvider($c->getDatabaseConnection(), $c->getLogger(), new TimeFactory());
+ return new DBLockingProvider($c->getDatabaseConnection(), $c->getLogger(), new TimeFactory(), $ttl);
}
return new NoopLockingProvider();
});