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 --- lib/Migration/RemoveUnusedJob.php | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lib/Migration/RemoveUnusedJob.php (limited to 'lib') 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