diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-03-24 14:07:43 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-04-07 08:24:13 +0200 |
commit | cdedda99e4b7f66f136d7db4788c2f033df2d442 (patch) | |
tree | 8a0650a3001c9a095c3bb104a206b697e8125eeb /lib/private/Server.php | |
parent | 9b930cd01d2a536cfa21ba08a3be737cdfe4e54b (diff) | |
download | nextcloud-server-cdedda99e4b7f66f136d7db4788c2f033df2d442.tar.gz nextcloud-server-cdedda99e4b7f66f136d7db4788c2f033df2d442.zip |
Make lock ttl configurable
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 9 |
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(); }); |