From 327b1a32f6895a403b39ffa77a6df2bf751b88c2 Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Mon, 22 Feb 2010 03:28:59 +0000 Subject: [PATCH] Use existing() for ensuring that the importer in question actually exists in DB or in code. Plus one minor cleanup in switch statement. --- includes/FeedsImporter.inc | 5 +---- includes/FeedsScheduler.inc | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/FeedsImporter.inc b/includes/FeedsImporter.inc index 19861053..a4c6f7a0 100644 --- a/includes/FeedsImporter.inc +++ b/includes/FeedsImporter.inc @@ -98,16 +98,13 @@ class FeedsImporter extends FeedsConfigurable { * Throws Exception if an error occurs working off the job. */ public function work($job) { - if ($this->export_type == FEEDS_EXPORT_NONE) { - return; - } switch ($job['callback']) { case 'import': return feeds_source($job['id'], $job['feed_nid'])->import(); - break; case 'expire': return $this->expire(); } + return FEEDS_BATCH_COMPLETE; } /** diff --git a/includes/FeedsScheduler.inc b/includes/FeedsScheduler.inc index 7adebec5..e05c6298 100644 --- a/includes/FeedsScheduler.inc +++ b/includes/FeedsScheduler.inc @@ -159,7 +159,7 @@ class FeedsScheduler implements FeedsSchedulerInterface { public function work($job) { $importer = feeds_importer($job['id']); try { - if (FEEDS_BATCH_COMPLETE == $importer->work($job)) { + if (FEEDS_BATCH_COMPLETE == $importer->existing()->work($job)) { $this->finished($job); } } -- GitLab