summaryrefslogtreecommitdiffstats
path: root/lib/private/lock/dblockingprovider.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-12-09 14:13:05 +0100
committerRobin Appelman <icewind@owncloud.com>2015-12-09 14:53:24 +0100
commite191953942fe6b32917c5e01f27879db87e369ce (patch)
treefd7afb26e4222b01a7e1f3e0a648105d7ab71015 /lib/private/lock/dblockingprovider.php
parent5c95939bf388111a21ca94461e37b1b0b0b38159 (diff)
downloadnextcloud-server-e191953942fe6b32917c5e01f27879db87e369ce.tar.gz
nextcloud-server-e191953942fe6b32917c5e01f27879db87e369ce.zip
Remove all locks after ttl from the db
Diffstat (limited to 'lib/private/lock/dblockingprovider.php')
-rw-r--r--lib/private/lock/dblockingprovider.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/lock/dblockingprovider.php b/lib/private/lock/dblockingprovider.php
index 90657e6725f..8d6ab52737c 100644
--- a/lib/private/lock/dblockingprovider.php
+++ b/lib/private/lock/dblockingprovider.php
@@ -235,10 +235,10 @@ class DBLockingProvider extends AbstractLockingProvider {
/**
* cleanup empty locks
*/
- public function cleanEmptyLocks() {
+ public function cleanExpiredLocks() {
$expire = $this->timeFactory->getTime();
$this->connection->executeUpdate(
- 'DELETE FROM `*PREFIX*file_locks` WHERE `lock` = 0 AND `ttl` < ?',
+ 'DELETE FROM `*PREFIX*file_locks` WHERE `ttl` < ?',
[$expire]
);
}
@@ -262,7 +262,7 @@ class DBLockingProvider extends AbstractLockingProvider {
public function __destruct() {
try {
- $this->cleanEmptyLocks();
+ $this->cleanExpiredLocks();
} catch (\Exception $e) {
// If the table is missing, the clean up was successful
if ($this->connection->tableExists('file_locks')) {