]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Hotpatch for Facebook mirror problems: drop messages when hitting rate limit (err...
authorBrion Vibber <brion@pobox.com>
Sun, 23 May 2010 00:43:56 +0000 (17:43 -0700)
committerBrion Vibber <brion@pobox.com>
Sun, 23 May 2010 00:43:56 +0000 (17:43 -0700)
plugins/Facebook/facebookutil.php

index ab2d427264254d4f15b8194f07af1044d8d9533f..045891649c3f39f459ee4b447837b5f91571375f 100644 (file)
@@ -158,9 +158,22 @@ function facebookBroadcastNotice($notice)
 
                 remove_facebook_app($flink);
 
-        } else {
+            } else if ($code == 341) {
+                // 341 Feed action request limit reached - Unable to update Facebook status
+                // Reposting immediately probably won't work, so drop the message for now. :(
+
+                common_log(LOG_ERR, "Facebook rate limit hit: dropping notice $notice->id");
+                return true;
+            } else {
 
                 // Try sending again later.
+                //
+                // @fixme at the moment, returning false here could lead to an infinite loop
+                // if the error condition isn't actually transitory.
+                //
+                // Temporarily throwing an exception to kill the process so it'll hit our
+                // retry limits.
+                throw new Exception("Facebook error $code on notice $notice->id");
 
                 return false;
             }