diff rhodecode/controllers/summary.py @ 3276:eaa887c6c0af beta

added recursion limit for stats gathering, sometimes it did >1000 loops which lead to python throwing max recursion depth exceeded error. ref #642
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 30 Jan 2013 22:30:52 +0100
parents b9ba0d4d3abf
children 1c32b72930fa
line wrap: on
line diff
--- a/rhodecode/controllers/summary.py	Wed Jan 30 22:10:07 2013 +0100
+++ b/rhodecode/controllers/summary.py	Wed Jan 30 22:30:52 2013 +0100
@@ -140,7 +140,9 @@
         if dbrepo.enable_statistics:
             c.show_stats = True
             c.no_data_msg = _('No data loaded yet')
-            run_task(get_commits_stats, c.dbrepo.repo_name, ts_min_y, ts_max_y)
+            recurse_limit = 500  # don't recurse more than 500 times when parsing
+            run_task(get_commits_stats, c.dbrepo.repo_name, ts_min_y,
+                     ts_max_y, recurse_limit)
         else:
             c.show_stats = False
             c.no_data_msg = _('Statistics are disabled for this repository')