Use env() properly throughout panel to avoid cache issues.

This commit is contained in:
Dane Everitt 2017-03-18 15:56:19 -04:00
parent 9a581ef536
commit 4f16509447
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
14 changed files with 68 additions and 100 deletions

View file

@ -36,11 +36,11 @@ class VersionService
*/
public function __construct()
{
self::$versions = Cache::remember('versions', env('VERSION_CACHE_TIME', 60), function () {
self::$versions = Cache::remember('versions', config('pterodactyl.cdn.cache'), function () {
$client = new Client();
try {
$response = $client->request('GET', env('VERSION_CHECK_URL', 'https://cdn.pterodactyl.io/releases/latest.json'));
$response = $client->request('GET', config('pterodactyl.cdn.url'));
if ($response->getStatusCode() === 200) {
return json_decode($response->getBody());
@ -52,7 +52,7 @@ class VersionService
return (object) [
'panel' => 'error',
'daemon' => 'error',
'discord' => 'https://pterodactyl.io',
'discord' => 'https://pterodactyl.io/discord',
];
}
});