Fixing force-flag for lock-releasing

This commit is contained in:
Philipp Holzer 2019-02-24 10:08:28 +01:00
parent 9f11476ca0
commit 9b07132b80
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
6 changed files with 23 additions and 11 deletions

View file

@ -68,9 +68,15 @@ class DatabaseLockDriver extends AbstractLockDriver
/**
* (@inheritdoc)
*/
public function releaseLock($key)
public function releaseLock($key, $force = false)
{
DBA::delete('locks', ['name' => $key, 'pid' => $this->pid]);
if ($force) {
$where = ['name' => $key];
} else {
$where = ['name' => $key, 'pid' => $this->pid];
}
DBA::delete('locks', $where);
$this->markRelease($key);