From 632f2cb6197663ae51c5c286707a933941395f6d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 5 Mar 2024 07:02:40 -0700 Subject: [PATCH 1/2] Update SoftwareUpdateService, add command to refresh latest versions --- .../Commands/SoftwareUpdateRefresh.php | 37 +++++++++++++++++++ .../Internal/SoftwareUpdateService.php | 7 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 app/Console/Commands/SoftwareUpdateRefresh.php 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(); }); From eccdbe1f57becaf63fac7bf5a5aa3bae0e33f656 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 5 Mar 2024 07:03:51 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) 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)