]> git.wh0rd.org - tt-rss.git/blobdiff - update_daemon2.php
update_rss_feed: bailout if cache is considered valid, but older than last_updated
[tt-rss.git] / update_daemon2.php
index 7062e8e354cd9bc08a205566a742b18ccf8de72e..6f493b9b580ceea25a321bd61eea869df9d29a9d 100755 (executable)
        $longopts = array("log:",
                        "tasks:",
                        "interval",
+                       "quiet",
                        "help");
 
        $options = getopt("", $longopts);
                // respect the spawn interval
                $next_spawn = $last_checkpoint + $spawn_interval - time();
 
-               if ($next_spawn % 10 == 0) {
+               if ($next_spawn % 60 == 0) {
                        $running_jobs = count($children);
                        _debug("[MASTER] active jobs: $running_jobs, next spawn at $next_spawn sec.");
                }
                                        // or regenerate feedbrowser cache
 
                                        if (rand(0,100) > 30) {
+                                               _debug("Waiting before update..");
+                                               sleep(rand(5,15));
                                                update_daemon_common($link);
                                        } else {
                                                $count = update_feedbrowser_cache($link);
                                        // We exit in order to avoid fork bombing.
                                        exit(0);
                                }
-
-                               // We wait a little time before the next fork, in order to let the first fork
-                               // mark the feeds it update :
-                               sleep(1);
                        }
                        $last_checkpoint = time();
                }