From 96ec645977a3e01cf9c85c87c2978ec63fc0121a Mon Sep 17 00:00:00 2001 From: Alex Barth <alex_b@53995.no-reply.drupal.org> Date: Sat, 27 Feb 2010 02:03:34 +0000 Subject: [PATCH] Simplify feeds_batch(). --- feeds.module | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/feeds.module b/feeds.module index 6ee2243c..f779e54c 100644 --- a/feeds.module +++ b/feeds.module @@ -426,14 +426,7 @@ function feeds_batch_set($title, $method, $importer_id, $feed_nid = 0) { function feeds_batch($method, $importer_id, $feed_nid = 0, &$context) { $context['finished'] = 1; try { - switch ($method) { - case 'import': - $context['finished'] = feeds_source($importer_id, $feed_nid)->import(); - break; - case 'clear': - $context['finished'] = feeds_source($importer_id, $feed_nid)->clear(); - break; - } + $context['finished'] = feeds_source($importer_id, $feed_nid)->$method(); } catch (Exception $e) { drupal_set_message($e->getMessage(), 'error'); -- GitLab