forked from GNUsocial/gnu-social
change find() to staticGet() to use cache
This commit is contained in:
parent
f414544d0d
commit
5a357d5399
@ -75,7 +75,6 @@ class Ostatus_profile extends Memcached_DataObject
|
|||||||
public $created;
|
public $created;
|
||||||
public $lastupdate;
|
public $lastupdate;
|
||||||
|
|
||||||
|
|
||||||
public /*static*/ function staticGet($k, $v=null)
|
public /*static*/ function staticGet($k, $v=null)
|
||||||
{
|
{
|
||||||
return parent::staticGet(__CLASS__, $k, $v);
|
return parent::staticGet(__CLASS__, $k, $v);
|
||||||
@ -598,9 +597,10 @@ class Ostatus_profile extends Memcached_DataObject
|
|||||||
|
|
||||||
// Double-check for oldies
|
// Double-check for oldies
|
||||||
// @fixme this could explode horribly for multiple feeds on a blog. sigh
|
// @fixme this could explode horribly for multiple feeds on a blog. sigh
|
||||||
$dupe = new Notice();
|
|
||||||
$dupe->uri = $notice->uri;
|
$dupe = Notice::staticGet('uri', $notice->uri);
|
||||||
if ($dupe->find(true)) {
|
|
||||||
|
if (!empty($dupe)) {
|
||||||
common_log(LOG_WARNING, __METHOD__ . ": tried to save dupe notice for entry {$notice->uri} of feed {$this->feeduri}");
|
common_log(LOG_WARNING, __METHOD__ . ": tried to save dupe notice for entry {$notice->uri} of feed {$this->feeduri}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user