From 04fcda9b1a1016e08316e14fef182d1955b5e4e6 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Thu, 2 Mar 2023 16:19:49 +0100 Subject: Remove unused job from db Our background job was renamed quite a while ago the old job remained in the db, to prevent confusion this adds a repair step to remove the old job. Signed-off-by: Benjamin Brahmer --- CHANGELOG.md | 2 +- appinfo/info.xml | 6 +++++ lib/Migration/RemoveUnusedJob.php | 51 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 lib/Migration/RemoveUnusedJob.php diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e269cb5..bd5513549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is mostly based on [Keep a Changelog](https://keepachangelog.com/en/1 # Unreleased ## [21.x.x] ### Changed - +- Remove unused background job OCA\News\Cron\Updater ### Fixed # Releases diff --git a/appinfo/info.xml b/appinfo/info.xml index 912fcabc8..8e06ff9bb 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -62,6 +62,12 @@ Report a [feed issue](https://github.com/nextcloud/news/discussions/new) OCA\News\Cron\UpdaterJob + + + OCA\News\Migration\RemoveUnusedJob + + + OCA\News\Command\ExploreGenerator OCA\News\Command\ShowFeed diff --git a/lib/Migration/RemoveUnusedJob.php b/lib/Migration/RemoveUnusedJob.php new file mode 100644 index 000000000..b0202f5a4 --- /dev/null +++ b/lib/Migration/RemoveUnusedJob.php @@ -0,0 +1,51 @@ +logger = $logger; + $this->joblist = $jobList; + } + + /** + * Returns the step's name + */ + public function getName() + { + return 'Remove the unused News update job'; + } + + /** + * @param IOutput $output + */ + public function run(IOutput $output) + { + if($this->joblist->has("OCA\News\Cron\Updater", null)){ + $output->info("Job exists, attempting to remove"); + $this->joblist->remove("OCA\News\Cron\Updater"); + $output->info("Job removed"); + } else { + $output->info("Job does not exist, all good"); + } + + } +} \ No newline at end of file -- cgit v1.2.3