Simplified code

This commit is contained in:
Michael 2020-05-18 22:34:47 +00:00
parent 2f8c6f00b5
commit e09965fcc5

View file

@ -2032,13 +2032,8 @@ class Item
*/ */
private static function insertActivity(array $item) private static function insertActivity(array $item)
{ {
$activity_index = self::activityToIndex($item['verb']); $fields = ['activity' => self::activityToIndex($item['verb']),
if ($activity_index < 0) { 'uri-hash' => (string)$item['uri-id'], 'uri-id' => $item['uri-id']];
// SHouldn't happen at all
return null;
}
$fields = ['activity' => $activity_index, 'uri-hash' => (string)$item['uri-id'], 'uri-id' => $item['uri-id']];
// To avoid timing problems, we are using locks. // To avoid timing problems, we are using locks.
$locked = DI::lock()->acquire('item_insert_activity'); $locked = DI::lock()->acquire('item_insert_activity');