mirror of
https://github.com/friendica/friendica
synced 2025-05-03 01:44:25 +02:00
Merge pull request #8071 from nupplaphil/task/Lock_to_lock
Replace Core\Lock wrapper with DI::lock() method
This commit is contained in:
commit
f67f398fe1
15 changed files with 75 additions and 130 deletions
|
@ -2060,7 +2060,7 @@ class Item
|
|||
}
|
||||
|
||||
// To avoid timing problems, we are using locks.
|
||||
$locked = Lock::acquire('item_insert_activity');
|
||||
$locked = DI::lock()->acquire('item_insert_activity');
|
||||
if (!$locked) {
|
||||
Logger::log("Couldn't acquire lock for URI " . $item['uri'] . " - proceeding anyway.");
|
||||
}
|
||||
|
@ -2076,11 +2076,11 @@ class Item
|
|||
} else {
|
||||
// This shouldn't happen.
|
||||
Logger::log('Could not insert activity for URI ' . $item['uri'] . ' - should not happen');
|
||||
Lock::release('item_insert_activity');
|
||||
DI::lock()->release('item_insert_activity');
|
||||
return false;
|
||||
}
|
||||
if ($locked) {
|
||||
Lock::release('item_insert_activity');
|
||||
DI::lock()->release('item_insert_activity');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2103,7 +2103,7 @@ class Item
|
|||
}
|
||||
|
||||
// To avoid timing problems, we are using locks.
|
||||
$locked = Lock::acquire('item_insert_content');
|
||||
$locked = DI::lock()->acquire('item_insert_content');
|
||||
if (!$locked) {
|
||||
Logger::log("Couldn't acquire lock for URI " . $item['uri'] . " - proceeding anyway.");
|
||||
}
|
||||
|
@ -2121,7 +2121,7 @@ class Item
|
|||
Logger::log('Could not insert content for URI ' . $item['uri'] . ' - should not happen');
|
||||
}
|
||||
if ($locked) {
|
||||
Lock::release('item_insert_content');
|
||||
DI::lock()->release('item_insert_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue