diff options
author | friendica <info@friendica.com> | 2014-06-29 18:18:29 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-06-29 18:18:29 -0700 |
commit | 33034bc9b6bc82a86c435ea71ff1967c28d77244 (patch) | |
tree | 533772ca518fa19fb30ff4deac389e7044675e31 /include/dir_fns.php | |
parent | cc22c1da508aeadba38cae29ef942c4c153a14e2 (diff) | |
download | volse-hubzilla-33034bc9b6bc82a86c435ea71ff1967c28d77244.tar.gz volse-hubzilla-33034bc9b6bc82a86c435ea71ff1967c28d77244.tar.bz2 volse-hubzilla-33034bc9b6bc82a86c435ea71ff1967c28d77244.zip |
limit updates from new dir servers to avoid exhausting memory.
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r-- | include/dir_fns.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php index 71800cb47..260fa3f93 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -98,7 +98,12 @@ function sync_directories($dirmode) { foreach($r as $rr) { if(! $rr['site_directory']) continue; - $x = z_fetch_url($rr['site_directory'] . '?f=&sync=' . urlencode($rr['site_sync'])); + + // for brand new directory servers, only load the last couple of days. Everything before that will be repeats. + + $syncdate = (($rr['site_sync'] === '0000-00-00 00:00:00') ? datetime_convert('UTC','UTC','now - 2 days') : $rr['site_sync']); + $x = z_fetch_url($rr['site_directory'] . '?f=&sync=' . urlencode($syncdate)); + if(! $x['success']) continue; $j = json_decode($x['body'],true); |