bulkDistribute won't add empty lists to database

This commit is contained in:
Mikael Nordfeldth 2016-01-16 17:34:27 +01:00
parent f53ebdeadb
commit c559b8ce2a
1 changed files with 5 additions and 0 deletions

View File

@ -251,12 +251,17 @@ class HubSub extends Managed_DataObject
*/
function bulkDistribute($atom, array $pushCallbacks)
{
if (empty($pushCallbacks)) {
common_log(LOG_ERR, 'Callback list empty for bulkDistribute.');
return false;
}
$data = array('atom' => $atom,
'topic' => $this->getTopic(),
'pushCallbacks' => $pushCallbacks);
common_log(LOG_INFO, "Queuing PuSH batch: {$this->getTopic()} to ".count($pushCallbacks)." sites");
$qm = QueueManager::get();
$qm->enqueue($data, 'hubprep');
return true;
}
/**