bulkDistribute won't add empty lists to database

This commit is contained in:
Mikael Nordfeldth 2016-01-16 17:34:27 +01:00
parent b0416ae592
commit 912d65c767

View File

@ -228,6 +228,10 @@ class HubSub extends Managed_DataObject
*/
function bulkDistribute($atom, $pushCallbacks)
{
if (empty($pushCallbacks)) {
common_log(LOG_ERR, 'Callback list empty for bulkDistribute.');
return false;
}
$data = array('atom' => $atom,
'topic' => $this->topic,
'pushCallbacks' => $pushCallbacks);
@ -235,6 +239,7 @@ class HubSub extends Managed_DataObject
count($pushCallbacks) . " sites");
$qm = QueueManager::get();
$qm->enqueue($data, 'hubprep');
return true;
}
/**