update server stat

This commit is contained in:
Tokumeikoi 2020-06-05 00:52:17 +08:00
parent 0fc9b1d867
commit 397436761f
4 changed files with 4 additions and 4 deletions

View File

@ -63,7 +63,7 @@ class V2boardCache extends Command
'd' => $serverLog->d,
'online' => $serverLog->online
];
Cache::put(CacheKey::get('SERVER_STAT', $serverLog->server_id), json_encode($data), 3600);
dd(Cache::put(CacheKey::get('SERVER_STAT', $serverLog->server_id), json_encode($data), 3600));
ServerStat::create($data);
}
}

View File

@ -26,7 +26,7 @@ class ServerController extends Controller
$server[$i]['tags'] = json_decode($server[$i]['tags']);
}
$server[$i]['group_id'] = json_decode($server[$i]['group_id']);
$serverStat = Cache::get(CacheKey::get('SERVER_STAT', $server[$i]['id']));
$serverStat = Cache::get(CacheKey::get('SERVER_STAT', $server[$i]['parent_id'] ? $server[$i]['parent_id'] : $server[$i]['id']));
if ($serverStat) {
$serverStat = json_decode($serverStat, true);
$server[$i]['u'] = $serverStat['u'];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long