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

Use existing() for ensuring that the importer in question actually exists in...

Use existing() for ensuring that the importer in question actually exists in DB or in code. Plus one minor cleanup in switch statement.
parent 820009d0
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
......@@ -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);
}
}
......
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