com web/doc: process only 10k news in one iteration: scripts/notes_stats.php

[email protected] (Ferenc Kovacs)
Newsgroups php.doc.web
Message-ID <[email protected]>
Commit:    faec00145a2558c38be60be34a80ff5012e74222
Author:    Ferenc Kovacs <[email protected]>         Thu, 28 Feb 2013 03:50:23 +0100
Parents:   3e955100138d3e422a51fce4d3ea43bd7317384b
Branches:  master

Link:       http://git.php.net/?p=web/doc.git;a=commitdiff;h=faec00145a2558c38be60be34a80ff5012e74222

Log:
process only 10k news in one iteration

Changed paths:
  M  scripts/notes_stats.php


Diff:
diff --git a/scripts/notes_stats.php b/scripts/notes_stats.php
index e838312..42b21c2 100644
--- a/scripts/notes_stats.php
+++ b/scripts/notes_stats.php
@@ -47,8 +47,13 @@ $res = nntp_cmd($s, 'GROUP php.notes', 211) or die("failed to get infos on news
 $first = sqlite_single_query($sqlite, 'SELECT last_article FROM info');
 list($last) = explode(' ', $res);
 
-if ($first > $last)
+if ($first > $last) {
     die("Nothing I can do, no new notes available\n");
+}
+// process only 10k news in one iteration
+elseif ($last > $first+10000) {
+    $last = $first+10000;
+}
 
 echo "Fetching items: $first-$last\n";
 nntp_cmd($s, "XOVER $first-$last", 224) or die("failed to XOVER the new items\n");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.