diff options
Diffstat (limited to 'plugins/YammerImport/lib/yammerqueuehandler.php')
-rw-r--r-- | plugins/YammerImport/lib/yammerqueuehandler.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/plugins/YammerImport/lib/yammerqueuehandler.php b/plugins/YammerImport/lib/yammerqueuehandler.php index ca81cbb34..5fc377783 100644 --- a/plugins/YammerImport/lib/yammerqueuehandler.php +++ b/plugins/YammerImport/lib/yammerqueuehandler.php @@ -36,11 +36,23 @@ class YammerQueueHandler extends QueueHandler function handle($notice) { - $importer = new YammerImporter(); - if ($importer->hasWork()) { - return $importer->iterate(); + $runner = YammerRunner::init(); + if ($runner->hasWork()) { + if ($runner->iterate()) { + if ($runner->hasWork()) { + // More to do? Shove us back on the queue... + $qm = QueueManager::get(); + $qm->enqueue('YammerImport', 'yammer'); + } + return true; + } else { + // Something failed? + // @fixme should we be trying again here, or should we give warning? + return false; + } } else { // We're done! + common_log(LOG_INFO, "Yammer import has no work to do at this time; discarding."); return true; } } |