cleanup empty locks

This commit is contained in:
Robin Appelman 2015-08-10 14:13:40 +02:00
parent 9729e67e3d
commit 06065189d7
1 changed files with 14 additions and 0 deletions

View File

@ -105,6 +105,7 @@ class DBLockingProvider extends AbstractLockingProvider {
[$path] [$path]
); );
} }
$this->markRelease($path, $type); $this->markRelease($path, $type);
} }
@ -133,4 +134,17 @@ class DBLockingProvider extends AbstractLockingProvider {
} }
$this->markChange($path, $targetType); $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();
}
} }