X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=update_feeds.php;h=4b6ad3c4fedba68b3b3fbc4b1e7c13282a23aed3;hb=45004d43408bb006f89dd2c46fb3b934966896b0;hp=4909d881ec0ea4d26b2dc18f116d72d7c4840920;hpb=34459667e259eb01257a73a4c30bff0ba2c3b3d5;p=tt-rss.git diff --git a/update_feeds.php b/update_feeds.php index 4909d881..4b6ad3c4 100644 --- a/update_feeds.php +++ b/update_feeds.php @@ -19,11 +19,13 @@ $lock_handle = make_lockfile($lock_filename); + // Try to lock a file in order to avoid concurrent update. if (!$lock_handle) { die("error: Can't create lockfile ($lock_filename). ". "Maybe another process is already running.\n"); } + // Create a database connection. $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); if (!$link) { @@ -44,14 +46,10 @@ } } - $result = db_query($link, "SELECT id FROM ttrss_users"); - - while ($line = db_fetch_assoc($result)) { - $user_id = $line["id"]; - initialize_user_prefs($link, $user_id); - update_all_feeds($link, false, $user_id, true); - } + // Update all feeds needing a update. + update_daemon_common($link, $limit=0); + // Send feed digests by email if needed. if (DAEMON_SENDS_DIGESTS) send_headlines_digests($link); db_close($link);