Skip to content
Snippets Groups Projects
Commit 96ec6459 authored by Alex Barth's avatar Alex Barth
Browse files

Simplify feeds_batch().

parent 404ee967
No related branches found
No related tags found
No related merge requests found
...@@ -426,14 +426,7 @@ function feeds_batch_set($title, $method, $importer_id, $feed_nid = 0) { ...@@ -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) { function feeds_batch($method, $importer_id, $feed_nid = 0, &$context) {
$context['finished'] = 1; $context['finished'] = 1;
try { try {
switch ($method) { $context['finished'] = feeds_source($importer_id, $feed_nid)->$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;
}
} }
catch (Exception $e) { catch (Exception $e) {
drupal_set_message($e->getMessage(), 'error'); drupal_set_message($e->getMessage(), 'error');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment