mirror of
https://github.com/friendica/friendica
synced 2025-05-03 23:44:10 +02:00
Fix slow queries
This commit is contained in:
parent
0277c55c43
commit
5f48d6497e
6 changed files with 47 additions and 17 deletions
|
@ -1959,7 +1959,7 @@ class Contact
|
|||
}
|
||||
|
||||
// If Probe::uri fails the network code will be different ("feed" or "unkn")
|
||||
if (in_array($ret['network'], [Protocol::FEED, Protocol::PHANTOM]) && ($ret['network'] != $contact['network'])) {
|
||||
if (($ret['network'] == Protocol::PHANTOM) || (($ret['network'] == Protocol::FEED) && ($ret['network'] != $contact['network']))) {
|
||||
self::updateContact($id, $uid, $contact['url'], $ret['url'], ['failed' => true, 'last-update' => $updated, 'failure_update' => $updated]);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -970,6 +970,10 @@ class Item
|
|||
unset($item['event-id']);
|
||||
}
|
||||
|
||||
if (empty($item['causer-id'])) {
|
||||
unset($item['causer-id']);
|
||||
}
|
||||
|
||||
Post::insert($item['uri-id'], $item);
|
||||
|
||||
if ($item['gravity'] == GRAVITY_PARENT) {
|
||||
|
|
|
@ -285,7 +285,7 @@ class Post
|
|||
$condition = DBA::mergeConditions($condition,
|
||||
["`visible` AND NOT `deleted`
|
||||
AND NOT `author-blocked` AND NOT `owner-blocked`
|
||||
AND (NOT `causer-blocked` OR `causer-id` = ?) AND NOT `contact-blocked`
|
||||
AND (NOT `causer-blocked` OR `causer-id` = ? OR `causer-id` IS NULL) AND NOT `contact-blocked`
|
||||
AND ((NOT `contact-readonly` AND NOT `contact-pending` AND (`contact-rel` IN (?, ?)))
|
||||
OR `self` OR `gravity` != ? OR `contact-uid` = ?)
|
||||
AND NOT EXISTS (SELECT `uri-id` FROM `post-user` WHERE `hidden` AND `uri-id` = `" . $view . "`.`uri-id` AND `uid` = ?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue