forked from GNUsocial/gnu-social
only blow public timeline cache if notice is in it
This commit is contained in:
parent
70cf37cb88
commit
5f365e75ca
@ -446,7 +446,10 @@ class Notice extends Memcached_DataObject
|
|||||||
function blowOnInsert($conversation = false)
|
function blowOnInsert($conversation = false)
|
||||||
{
|
{
|
||||||
self::blow('profile:notice_ids:%d', $this->profile_id);
|
self::blow('profile:notice_ids:%d', $this->profile_id);
|
||||||
|
|
||||||
|
if ($this->isPublic()) {
|
||||||
self::blow('public');
|
self::blow('public');
|
||||||
|
}
|
||||||
|
|
||||||
// XXX: Before we were blowing the casche only if the notice id
|
// XXX: Before we were blowing the casche only if the notice id
|
||||||
// was not the root of the conversation. What to do now?
|
// was not the root of the conversation. What to do now?
|
||||||
@ -481,8 +484,11 @@ class Notice extends Memcached_DataObject
|
|||||||
$this->blowOnInsert();
|
$this->blowOnInsert();
|
||||||
|
|
||||||
self::blow('profile:notice_ids:%d;last', $this->profile_id);
|
self::blow('profile:notice_ids:%d;last', $this->profile_id);
|
||||||
|
|
||||||
|
if ($this->isPublic()) {
|
||||||
self::blow('public;last');
|
self::blow('public;last');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** save all urls in the notice to the db
|
/** save all urls in the notice to the db
|
||||||
*
|
*
|
||||||
@ -2107,4 +2113,14 @@ class Notice extends Memcached_DataObject
|
|||||||
$obj->whereAdd($max);
|
$obj->whereAdd($max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isPublic()
|
||||||
|
{
|
||||||
|
if (common_config('public', 'localonly')) {
|
||||||
|
return ($this->is_local == Notice::LOCAL_PUBLIC);
|
||||||
|
} else {
|
||||||
|
return (($this->is_local != Notice::LOCAL_NONPUBLIC) &&
|
||||||
|
($this->is_local != Notice::GATEWAY));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user