fix(vikon): store version in file instead of cache to prevent revert after TTL expiry

This commit is contained in:
F4ilji
2026-07-06 13:28:22 +05:00
parent 9f4dfd9bfc
commit 65f4220932
6 changed files with 31 additions and 43 deletions
@@ -345,7 +345,14 @@ class UpdateCoreAction
$latestVersion = $body['version'] ?? null;
if ($latestVersion) {
cache()->put('vikon:current_version', $latestVersion, 3600);
$file = config('vikon.version_file');
if ($file) {
$dir = dirname($file);
if (!is_dir($dir)) {
mkdir($dir, 0755, true);
}
file_put_contents($file, $latestVersion);
}
Log::channel('vikon')->info('Vikon: version updated', ['version' => $latestVersion]);
}
} catch (\Throwable $e) {