diff options
author | cedricbonhomme <devnull@localhost> | 2010-11-04 21:43:42 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-11-04 21:43:42 +0100 |
commit | d2c2c43e6a0fe38c33eb8560592c712cf42b99ab (patch) | |
tree | 8cea5fa8b7ef13eb635245a54970b4bdade1ab42 | |
parent | Updated address of contact. (diff) | |
download | newspipe-d2c2c43e6a0fe38c33eb8560592c712cf42b99ab.tar.gz newspipe-d2c2c43e6a0fe38c33eb8560592c712cf42b99ab.tar.bz2 newspipe-d2c2c43e6a0fe38c33eb8560592c712cf42b99ab.zip |
Major improvement of the performance (concerning the management page).
-rwxr-xr-x | pyAggr3g470r.py | 5 |
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 |