X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fdistribqueuehandler.php;h=d2be7a92c72488d846374bb27413f103490fd34d;hb=f39d3e34bb5298f13824699c7090e05b75d7549b;hp=f458d238da97c77cdd6006ee821de09ab361c36b;hpb=663e4e02a1b3b1c104c2c3db19e524a486c3d981;p=quix0rs-gnu-social.git diff --git a/lib/distribqueuehandler.php b/lib/distribqueuehandler.php index f458d238da..d2be7a92c7 100644 --- a/lib/distribqueuehandler.php +++ b/lib/distribqueuehandler.php @@ -62,23 +62,36 @@ class DistribQueueHandler { // XXX: do we need to change this for remote users? - $notice->saveTags(); + try { + $notice->addToInboxes(); + } catch (Exception $e) { + $this->logit($notice, $e); + } - $groups = $notice->saveGroups(); + try { + Event::handle('EndNoticeSave', array($notice)); + // Enqueue for other handlers + } catch (Exception $e) { + $this->logit($notice, $e); + } - $recipients = $notice->saveReplies(); + try { + common_enqueue_notice($notice); + } catch (Exception $e) { + $this->logit($notice, $e); + } - $notice->addToInboxes($groups, $recipients); - - $notice->saveUrls(); - - Event::handle('EndNoticeSave', array($notice)); - - // Enqueue for other handlers + return true; + } - common_enqueue_notice($notice); + protected function logit($notice, $e) + { + common_log(LOG_ERR, "Distrib queue exception saving notice $notice->id: " . + $e->getMessage() . ' ' . + str_replace("\n", " ", $e->getTraceAsString())); - return true; + // We'll still return true so we don't get stuck in a loop + // trying to run a bad insert over and over... } }