aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-11-04 21:43:42 +0100
committercedricbonhomme <devnull@localhost>2010-11-04 21:43:42 +0100
commitd2c2c43e6a0fe38c33eb8560592c712cf42b99ab (patch)
tree8cea5fa8b7ef13eb635245a54970b4bdade1ab42 /pyAggr3g470r.py
parentUpdated address of contact. (diff)
downloadnewspipe-d2c2c43e6a0fe38c33eb8560592c712cf42b99ab.tar.gz
newspipe-d2c2c43e6a0fe38c33eb8560592c712cf42b99ab.tar.bz2
newspipe-d2c2c43e6a0fe38c33eb8560592c712cf42b99ab.zip
Major improvement of the performance (concerning the management page).
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-xpyAggr3g470r.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index d5dcc137..e8525526 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -274,7 +274,10 @@ class Root:
# Some statistics
if self.articles:
- self.top_words = utils.top_words(self.articles, n=50, size=int(word_size))
+ if not hasattr(self, 'top_words') or os.path.getmtime(utils.sqlite_base) != self.last_top_words_update:
+ # only when the base has changed for best performance
+ self.top_words = utils.top_words(self.articles, n=50, size=int(word_size))
+ self.last_top_words_update = os.path.getmtime(utils.sqlite_base)
html += "<h1>Statistics</h1>\n<br />\n"
if "oice" not in utils.IMPORT_ERROR:
# counter object to count the number of
bgstack15