改进 测试环境中永久保存服务器数据
This commit is contained in:
parent
7ab179fe67
commit
0aa87c5025
@ -49,6 +49,7 @@ public function handle()
|
||||
// 只保留 name, status
|
||||
$servers = array_merge($servers, array_map(function ($server) use ($module) {
|
||||
return [
|
||||
'module_id' => $module->id,
|
||||
'module_name' => $module->name,
|
||||
'name' => $server['name'],
|
||||
'status' => $server['status'],
|
||||
@ -63,8 +64,12 @@ public function handle()
|
||||
}
|
||||
}
|
||||
|
||||
// Cache servers
|
||||
// if local
|
||||
if (config('app.env') === 'local') {
|
||||
Cache::forever('servers', $servers);
|
||||
} else {
|
||||
Cache::put('servers', $servers, now()->addMinutes(10));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user