This clean feature is too SQL intensive. Only check clean if in mod.php

This commit is contained in:
8chan 2015-04-06 20:12:37 -07:00
parent 37f7406db8
commit bd128bf465
2 changed files with 6 additions and 4 deletions

View File

@ -415,10 +415,10 @@ class Post {
));
}
public function getClean( ) {
public function getClean($actually_do = false) {
global $board, $config;
if( !isset( $this->clean ) ) {
if( !isset( $this->clean ) && $actually_do ) {
if ($config['cache']['enabled'] && $this->clean = cache::get("post_clean_{$board['uri']}_{$this->id}")) {
return $this->clean;
}
@ -441,8 +441,10 @@ class Post {
if ($config['cache']['enabled'])
cache::set("post_clean_{$board['uri']}_{$this->id}", $this->clean);
}
} else {
$this->clean = array();
}
return $this->clean;
}
};

View File

@ -2507,7 +2507,7 @@ function mod_reports() {
}
// Fetch clean status.
$po->getClean();
$po->getClean(true);
$clean = $po->clean;