Merge pull request #5332 from annando/fix-lock

urgent bugfix: Wrong function name for locks
This commit is contained in:
Michael Vogel 2018-07-08 11:35:21 +02:00 committed by GitHub
commit c6efbcd1aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1731,7 +1731,7 @@ class Item extends BaseObject
} }
// To avoid timing problems, we are using locks. // To avoid timing problems, we are using locks.
$locked = Lock::set('item_insert_activity'); $locked = Lock::acquire('item_insert_activity');
if (!$locked) { if (!$locked) {
logger("Couldn't acquire lock for URI " . $item['uri'] . " - proceeding anyway."); logger("Couldn't acquire lock for URI " . $item['uri'] . " - proceeding anyway.");
} }
@ -1751,7 +1751,7 @@ class Item extends BaseObject
return false; return false;
} }
if ($locked) { if ($locked) {
Lock::remove('item_insert_activity'); Lock::release('item_insert_activity');
} }
return true; return true;
} }