summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-08-10 14:13:40 +0200
committerRobin Appelman <icewind@owncloud.com>2015-08-10 14:15:29 +0200
commit06065189d768e5b33cb4798403db34b12cb60ef7 (patch)
treea9509e99cfc4fcd65cccc6a26689a08f2cbfa4b0 /lib
parent9729e67e3d2dec127e2d9e3d47d01d4de806b302 (diff)
downloadnextcloud-server-06065189d768e5b33cb4798403db34b12cb60ef7.tar.gz
nextcloud-server-06065189d768e5b33cb4798403db34b12cb60ef7.zip
cleanup empty locks
Diffstat (limited to 'lib')
-rw-r--r--lib/private/lock/dblockingprovider.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/lock/dblockingprovider.php b/lib/private/lock/dblockingprovider.php
index 60d516e17c0..5480a6e53af 100644
--- a/lib/private/lock/dblockingprovider.php
+++ b/lib/private/lock/dblockingprovider.php
@@ -105,6 +105,7 @@ class DBLockingProvider extends AbstractLockingProvider {
[$path]
);
}
+
$this->markRelease($path, $type);
}
@@ -133,4 +134,17 @@ class DBLockingProvider extends AbstractLockingProvider {
}
$this->markChange($path, $targetType);
}
+
+ /**
+ * cleanup empty locks
+ */
+ public function cleanEmptyLocks() {
+ $this->connection->executeUpdate(
+ 'DELETE FROM `*PREFIX*file_locks` WHERE `lock` = 0'
+ );
+ }
+
+ public function __destruct() {
+ $this->cleanEmptyLocks();
+ }
}