]> git.wh0rd.org Git - tt-rss.git/commitdiff
daemon2: make update tasks to wait before starting updates to improve
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 09:32:47 +0000 (13:32 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 09:32:50 +0000 (13:32 +0400)
last_update_started handling (refs #647)

update_daemon2.php

index 9403d71a45dfa441c3c0e2f7c484e79b9fe9fd71..6f493b9b580ceea25a321bd61eea869df9d29a9d 100755 (executable)
                                        // 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(10);
                        }
                        $last_checkpoint = time();
                }