refactor(vikon): use Redis cache for version instead of file

This commit is contained in:
F4ilji
2026-07-05 15:11:17 +05:00
parent ad8a4d861b
commit eb142b2513
6 changed files with 13 additions and 28 deletions
@@ -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';
}
}