summaryrefslogtreecommitdiff
path: root/lib/distribqueuehandler.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-02-04 16:56:34 +0000
committerSarven Capadisli <csarven@status.net>2010-02-04 16:56:34 +0000
commit7ebd13fa69d2a5dac8bc59799281d3d6e017eeae (patch)
tree605267bbe7c902d7a71766cdeb523bfbb266a0f9 /lib/distribqueuehandler.php
parent339eb1adadc7f3495ad31ef0a5cf20cdca47ce1f (diff)
parent9e940445f1ab1ec53f3bad14a1a94dc2064d0ee6 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/distribqueuehandler.php')
-rw-r--r--lib/distribqueuehandler.php55
1 files changed, 46 insertions, 9 deletions
diff --git a/lib/distribqueuehandler.php b/lib/distribqueuehandler.php
index f458d238d..4477468d0 100644
--- a/lib/distribqueuehandler.php
+++ b/lib/distribqueuehandler.php
@@ -62,23 +62,60 @@ class DistribQueueHandler
{
// XXX: do we need to change this for remote users?
- $notice->saveTags();
+ try {
+ $notice->saveTags();
+ } catch (Exception $e) {
+ $this->logit($notice, $e);
+ }
- $groups = $notice->saveGroups();
+ try {
+ $groups = $notice->saveGroups();
+ } catch (Exception $e) {
+ $this->logit($notice, $e);
+ }
- $recipients = $notice->saveReplies();
+ try {
+ $recipients = $notice->saveReplies();
+ } catch (Exception $e) {
+ $this->logit($notice, $e);
+ }
- $notice->addToInboxes($groups, $recipients);
+ try {
+ $notice->addToInboxes($groups, $recipients);
+ } catch (Exception $e) {
+ $this->logit($notice, $e);
+ }
- $notice->saveUrls();
+ try {
+ $notice->saveUrls();
+ } catch (Exception $e) {
+ $this->logit($notice, $e);
+ }
- Event::handle('EndNoticeSave', array($notice));
+ try {
+ Event::handle('EndNoticeSave', array($notice));
+ // Enqueue for other handlers
+ } catch (Exception $e) {
+ $this->logit($notice, $e);
+ }
- // Enqueue for other handlers
-
- common_enqueue_notice($notice);
+ try {
+ common_enqueue_notice($notice);
+ } catch (Exception $e) {
+ $this->logit($notice, $e);
+ }
return true;
}
+
+ protected function logit($notice, $e)
+ {
+ common_log(LOG_ERR, "Distrib queue exception saving notice $notice->id: " .
+ $e->getMessage() . ' ' .
+ str_replace("\n", " ", $e->getTraceAsString()));
+
+ // We'll still return true so we don't get stuck in a loop
+ // trying to run a bad insert over and over...
+ }
}