mirror of
https://github.com/v2board/v2board.git
synced 2025-02-11 16:00:27 +08:00
update cacheServerStat
This commit is contained in:
parent
397436761f
commit
a40a1ab674
@ -5,7 +5,6 @@ namespace App\Console\Commands;
|
|||||||
use App\Utils\CacheKey;
|
use App\Utils\CacheKey;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use App\Models\ServerLog;
|
use App\Models\ServerLog;
|
||||||
use App\Models\ServerStat;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
@ -42,10 +41,10 @@ class V2boardCache extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->serverStat();
|
$this->cacheServerStat();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function serverStat()
|
private function cacheServerStat()
|
||||||
{
|
{
|
||||||
$serverLogs = ServerLog::select(
|
$serverLogs = ServerLog::select(
|
||||||
'server_id',
|
'server_id',
|
||||||
@ -63,8 +62,7 @@ class V2boardCache extends Command
|
|||||||
'd' => $serverLog->d,
|
'd' => $serverLog->d,
|
||||||
'online' => $serverLog->online
|
'online' => $serverLog->online
|
||||||
];
|
];
|
||||||
dd(Cache::put(CacheKey::get('SERVER_STAT', $serverLog->server_id), json_encode($data), 3600));
|
Cache::put(CacheKey::get('SERVER_STAT', $serverLog->server_id), json_encode($data), 3600);
|
||||||
ServerStat::create($data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user