Skip to content
Snippets Groups Projects
Commit bef80f1e authored by Tibo's avatar Tibo
Browse files

add cache

parent 7bb799b1
No related branches found
No related tags found
No related merge requests found
Pipeline #3753 passed
......@@ -74,11 +74,11 @@ class Server extends Model
$start = time() - 24 * 3600;
$records = \Mongo::get()->monitoring->records->find([
$this->records_1day = \Mongo::get()->monitoring->records->find([
"server_id" => $this->id,
"time" => ['$gte' => $start]])
->toArray();
return $records;
return $this->records_1day;
}
public function hasData() : bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment