aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/lock
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-10 13:51:18 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-10 13:51:18 +0100
commitdf15d54db65a692f2ecf9307ae2a9b43c8fe0697 (patch)
tree38ceec2ef0c89f7f40e4e961deea8623b5c3d37b /lib/private/lock
parent744ef6141bc190e21ddd24a9cad5829443ca0c1e (diff)
parente191953942fe6b32917c5e01f27879db87e369ce (diff)
downloadnextcloud-server-df15d54db65a692f2ecf9307ae2a9b43c8fe0697.tar.gz
nextcloud-server-df15d54db65a692f2ecf9307ae2a9b43c8fe0697.zip
Merge pull request #21072 from owncloud/db-lock-ttl
Remove all locks after ttl from the db
Diffstat (limited to 'lib/private/lock')
-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 b3a12bb9a07..1b5142a90d2 100644
--- a/lib/private/lock/dblockingprovider.php
+++ b/lib/private/lock/dblockingprovider.php
@@ -233,10 +233,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]
);
}
@@ -260,7 +260,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')) {