diff --git a/CHANGELOG.md b/CHANGELOG.md index 401d67041..7fc7a1582 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Release Notes ## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.13...dev) + +### Updates + +- Update SoftwareUpdateService, add command to refresh latest versions ([632f2cb6](https://github.com/pixelfed/pixelfed/commit/632f2cb6)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.13 (2024-03-05)](https://github.com/pixelfed/pixelfed/compare/v0.11.12...v0.11.13) diff --git a/app/Console/Commands/SoftwareUpdateRefresh.php b/app/Console/Commands/SoftwareUpdateRefresh.php new file mode 100644 index 000000000..c486d58ce --- /dev/null +++ b/app/Console/Commands/SoftwareUpdateRefresh.php @@ -0,0 +1,37 @@ +info('Succesfully updated software versions!'); + } +} diff --git a/app/Services/Internal/SoftwareUpdateService.php b/app/Services/Internal/SoftwareUpdateService.php index 40aaf867e..492596bf7 100644 --- a/app/Services/Internal/SoftwareUpdateService.php +++ b/app/Services/Internal/SoftwareUpdateService.php @@ -11,11 +11,16 @@ class SoftwareUpdateService { const CACHE_KEY = 'pf:services:software-update:'; + public static function cacheKey() + { + return self::CACHE_KEY . 'latest:v1.0.0'; + } + public static function get() { $curVersion = config('pixelfed.version'); - $versions = Cache::remember(self::CACHE_KEY . 'latest:v1.0.0', 1800, function() { + $versions = Cache::remember(self::cacheKey(), 1800, function() { return self::fetchLatest(); });