Minor queue fixes, probably not very important. Preparing for cron

This commit is contained in:
Mikael Nordfeldth 2013-11-13 18:15:21 +01:00
parent 0a93fa68f3
commit 1a0e17fea6
3 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class DBQueueManager extends QueueManager
$qi->created = common_sql_now(); $qi->created = common_sql_now();
$result = $qi->insert(); $result = $qi->insert();
if (!$result) { if ($result === false) {
common_log_db_error($qi, 'INSERT', __FILE__); common_log_db_error($qi, 'INSERT', __FILE__);
throw new ServerException('DB error inserting queue item'); throw new ServerException('DB error inserting queue item');
} }

View File

@ -67,6 +67,9 @@ abstract class QueueManager extends IoManager
self::$qm = new UnQueueManager(); self::$qm = new UnQueueManager();
} else { } else {
switch ($type) { switch ($type) {
case 'cron':
self::$qm = new GNUsocialCron();
break;
case 'db': case 'db':
self::$qm = new DBQueueManager(); self::$qm = new DBQueueManager();
break; break;

View File

@ -37,7 +37,7 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
$daemons = array(); $daemons = array();
$daemons[] = INSTALLDIR.'/scripts/queuedaemon.php'; #$daemons[] = INSTALLDIR.'/scripts/queuedaemon.php';
if (Event::handle('GetValidDaemons', array(&$daemons))) { if (Event::handle('GetValidDaemons', array(&$daemons))) {
foreach ($daemons as $daemon) { foreach ($daemons as $daemon) {