cache reported image count
This commit is contained in:
parent
5a93e650c1
commit
d87e53ab90
@ -152,7 +152,14 @@ class ReportImage extends Extension {
|
||||
|
||||
public function count_reported_images() {
|
||||
global $database;
|
||||
return $database->get_one("SELECT count(*) FROM image_reports");
|
||||
|
||||
$count = $database->cache->get("image-report-count");
|
||||
if(is_null($count) || $count === false) {
|
||||
$count = $database->get_one("SELECT count(*) FROM image_reports");
|
||||
$database->cache->set("image-report-count", $count, 60);
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
// ===== Changelog =====
|
||||
|
Loading…
x
Reference in New Issue
Block a user