summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();
+ }
}