]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
log some errors for missed inserts
authorEvan Prodromou <evan@prodromou.name>
Fri, 4 Jul 2008 06:20:56 +0000 (02:20 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 4 Jul 2008 06:20:56 +0000 (02:20 -0400)
darcs-hash:20080704062056-84dde-6d5173a345be8fe3e9099e09b438fe69f3d2a1e2.gz

lib/util.php

index 3dec09d8e722e65173b5217dc2fbd51f72887f9d..e62e800dc58a84002dacf2ff3127c0f671f8dbb6 100644 (file)
@@ -819,13 +819,16 @@ function common_broadcast_notice($notice, $remote=false) {
 # Stick the notice on the queue
 
 function common_enqueue_notice($notice) {
-       common_log(LOG_INFO, 'queueing notice ID = ' . $notice->id);
+       common_log(LOG_INFO, 'start queueing notice ID = ' . $notice->id);
        $qi = new Queue_item();
-        $qi->query('BEGIN');
        $qi->notice_id = $notice->id;
        $qi->created = DB_DataObject_Cast::dateTime();
        $result = $qi->insert();
-        $qi->query('COMMIT');
+       if ($result === FALSE) {
+               common_log_db_error($qi, 'INSERT', __FILE__);
+               return;
+       }
+       common_log(LOG_INFO, 'complete queueing notice ID = ' . $notice->id);
        return $result;
 }