aboutsummaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-30 21:56:07 -0700
committerFriendika <info@friendika.com>2011-06-30 21:56:07 -0700
commit481cd708acfd3291eed7eba6af596c541651963c (patch)
tree57419b2e19f2102b4e8580bd0d3071514a962bc0 /addon
parent84ee783a2acb3ad0575b8f8cadeda1a009d1bd99 (diff)
downloadvolse-hubzilla-481cd708acfd3291eed7eba6af596c541651963c.tar.gz
volse-hubzilla-481cd708acfd3291eed7eba6af596c541651963c.tar.bz2
volse-hubzilla-481cd708acfd3291eed7eba6af596c541651963c.zip
allow polling to mostly survive minor memory shortages.
Diffstat (limited to 'addon')
-rw-r--r--addon/facebook/facebook.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index 49f193804..c54d5b5f0 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -376,9 +376,12 @@ function facebook_cron($a,$b) {
logger('facebook_cron');
- set_config('facebook','last_poll', time());
- $r = q("SELECT * FROM `pconfig` WHERE `cat` = 'facebook' AND `k` = 'post' AND `v` = '1' ");
+ // Find the FB users on this site and randomize in case one of them
+ // uses an obscene amount of memory. It may kill this queue run
+ // but hopefully we'll get a few others through on each run.
+
+ $r = q("SELECT * FROM `pconfig` WHERE `cat` = 'facebook' AND `k` = 'post' AND `v` = '1' ORDER BY RAND() ");
if(count($r)) {
foreach($r as $rr) {
// check for new friends once a day
@@ -392,6 +395,9 @@ function facebook_cron($a,$b) {
fb_consume_all($rr['uid']);
}
}
+
+ set_config('facebook','last_poll', time());
+
}