refactor(vikon): use Redis cache for version instead of file
This commit is contained in:
@@ -45,7 +45,7 @@ class VikonController extends Controller
|
||||
|
||||
return inertia()->render('Dashboard/VikonUpdates/Index', [
|
||||
'is_authenticated' => $isAuth,
|
||||
'current_version' => $this->getCurrentVersion(),
|
||||
'current_version' => app('vikon.version'),
|
||||
'modules' => config('vikon.modules'),
|
||||
'parts' => $parts,
|
||||
'vikon_api_domain' => config('vikon.api_domain'),
|
||||
@@ -220,16 +220,4 @@ class VikonController extends Controller
|
||||
|
||||
return response()->json(['url' => $url]);
|
||||
}
|
||||
|
||||
private function getCurrentVersion(): string
|
||||
{
|
||||
$versionFile = config('vikon.current_version_file');
|
||||
if ($versionFile && file_exists($versionFile)) {
|
||||
$version = trim(file_get_contents($versionFile));
|
||||
if ($version !== '') {
|
||||
return $version;
|
||||
}
|
||||
}
|
||||
return '1.0.0';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user