summaryrefslogtreecommitdiff
path: root/update_daemon.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-03-08 18:36:42 +0100
committerAndrew Dolgov <[email protected]>2007-03-08 18:36:42 +0100
commit6f9e33e45d7f857f1b8b36c2a8fee261562ceb21 (patch)
treefb2d51a6273aababe8284476efbea6b6b448b488 /update_daemon.php
parent06719138737a450eba676864a004e6f4959b39c5 (diff)
add timestamps to daemon debug output
Diffstat (limited to 'update_daemon.php')
-rw-r--r--update_daemon.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/update_daemon.php b/update_daemon.php
index 77660f09d..632795019 100644
--- a/update_daemon.php
+++ b/update_daemon.php
@@ -59,7 +59,7 @@
while (true) {
if (time() - $last_purge > PURGE_INTERVAL) {
- print "Purging old posts (random 30 feeds)...\n";
+ _debug("Purging old posts (random 30 feeds)...");
global_purge_old_posts($link, true, 30);
$last_purge = time();
}
@@ -113,7 +113,7 @@
$user_prefs_cache = array();
- printf("Scheduled %d feeds to update...\n", db_num_rows($result));
+ _debug(sprintf("Scheduled %d feeds to update...\n", db_num_rows($result)));
while ($line = db_fetch_assoc($result)) {
@@ -134,25 +134,26 @@
continue;
}
- print "Feed: " . $line["feed_url"] . ": ";
+ _debug("Feed: " . $line["feed_url"]);
- printf("(%d/%d, %d) ", time() - strtotime($line["last_updated"]),
- $upd_intl*60, $user_id);
+// _debug(sprintf("\tLU: %d, INTL: %d, UID: %d) ",
+// time() - strtotime($line["last_updated"]), $upd_intl*60, $user_id));
if (!$line["last_updated"] ||
time() - strtotime($line["last_updated"]) > ($upd_intl * 60)) {
-
- print "Updating...\n";
+
+ _debug("\tUpdating...");
+
update_rss_feed($link, $line["feed_url"], $line["id"], true);
sleep(1); // prevent flood (FIXME make this an option?)
} else {
- print "Update not needed.\n";
+ _debug("\tUpdate not needed.");
}
}
if (DAEMON_SENDS_DIGESTS) send_headlines_digests($link);
- print "Sleeping for " . DAEMON_SLEEP_INTERVAL . " seconds...\n";
+ _debug("Sleeping for " . DAEMON_SLEEP_INTERVAL . " seconds...");
sleep(DAEMON_SLEEP_INTERVAL);
}