diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-07-04 20:22:07 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-07-04 20:22:07 -0400 |
commit | 25e93288ba63dd65285dab68935b05b4e077aff5 (patch) | |
tree | 64818929855f7121d4445b51ce66cc2a16f9f479 /lib/util.php | |
parent | 84b1f41279fb7259c206047ff965977935137e35 (diff) |
a little more error-checking in the queuedaemon
darcs-hash:20080705002207-84dde-c5bc4da7dbca8a32ea4126badb772e99bd4f8bf1.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/util.php b/lib/util.php index 8beaa77d3..6aff62786 100644 --- a/lib/util.php +++ b/lib/util.php @@ -810,9 +810,9 @@ function common_redirect($url, $code=307) { function common_broadcast_notice($notice, $remote=false) { if (common_config('queue', 'enabled')) { # Do it later! - common_enqueue_notice($notice); + return common_enqueue_notice($notice); } else { - common_real_broadcast($notice, $remote); + return common_real_broadcast($notice, $remote); } } @@ -827,24 +827,26 @@ function common_enqueue_notice($notice) { if ($result === FALSE) { $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); common_log(LOG_ERROR, 'DB error inserting queue item: ' . $last_error->message); - return; + return false; } common_log(LOG_INFO, 'complete queueing notice ID = ' . $notice->id); return $result; } function common_real_broadcast($notice, $remote=false) { - // XXX: optionally use a queue system like http://code.google.com/p/microapps/wiki/NQDQ + $success = true; if (!$remote) { # Make sure we have the OMB stuff require_once(INSTALLDIR.'/lib/omb.php'); - omb_broadcast_remote_subscribers($notice); + $success = omb_broadcast_remote_subscribers($notice); + } + if ($success) { + require_once(INSTALLDIR.'/lib/jabber.php'); + $success = jabber_broadcast_notice($notice); } - require_once(INSTALLDIR.'/lib/jabber.php'); - jabber_broadcast_notice($notice); // XXX: broadcast notices to SMS // XXX: broadcast notices to other IM - return true; + return $success; } function common_broadcast_profile($profile) { |