##// END OF EJS Templates
moved statistics parse_limit into .ini files...
marcink -
r1076:db71228a beta
parent child Browse files
Show More
@@ -45,8 +45,10 b' static_files = true'
45 lang=en
45 lang=en
46 cache_dir = %(here)s/data
46 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 app_instance_uuid = develop
48 cut_off_limit = 256000
49 cut_off_limit = 256000
49 force_https = false
50 force_https = false
51 commit_parse_limit = 25
50
52
51 ####################################
53 ####################################
52 ### CELERY CONFIG ####
54 ### CELERY CONFIG ####
@@ -70,7 +72,7 b' celery.result.serialier = json'
70 celeryd.concurrency = 2
72 celeryd.concurrency = 2
71 #celeryd.log.file = celeryd.log
73 #celeryd.log.file = celeryd.log
72 celeryd.log.level = debug
74 celeryd.log.level = debug
73 celeryd.max.tasks.per.child = 3
75 celeryd.max.tasks.per.child = 1
74
76
75 #tasks will never be sent to the queue, but executed locally instead.
77 #tasks will never be sent to the queue, but executed locally instead.
76 celery.always.eager = false
78 celery.always.eager = false
@@ -78,8 +80,9 b' celery.always.eager = false'
78 ####################################
80 ####################################
79 ### BEAKER CACHE ####
81 ### BEAKER CACHE ####
80 ####################################
82 ####################################
81 beaker.cache.data_dir=/%(here)s/data/cache/data
83 beaker.cache.data_dir=%(here)s/data/cache/data
82 beaker.cache.lock_dir=/%(here)s/data/cache/lock
84 beaker.cache.lock_dir=%(here)s/data/cache/lock
85
83 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
86 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
84
87
85 beaker.cache.super_short_term.type=memory
88 beaker.cache.super_short_term.type=memory
@@ -47,6 +47,7 b' cache_dir = %(here)s/data'
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 cut_off_limit = 256000
48 cut_off_limit = 256000
49 force_https = false
49 force_https = false
50 commit_parse_limit = 250
50
51
51 ####################################
52 ####################################
52 ### CELERY CONFIG ####
53 ### CELERY CONFIG ####
@@ -70,7 +71,7 b' celery.result.serialier = json'
70 celeryd.concurrency = 2
71 celeryd.concurrency = 2
71 #celeryd.log.file = celeryd.log
72 #celeryd.log.file = celeryd.log
72 celeryd.log.level = debug
73 celeryd.log.level = debug
73 celeryd.max.tasks.per.child = 3
74 celeryd.max.tasks.per.child = 1
74
75
75 #tasks will never be sent to the queue, but executed locally instead.
76 #tasks will never be sent to the queue, but executed locally instead.
76 celery.always.eager = false
77 celery.always.eager = false
@@ -48,6 +48,7 b' index_dir = %(here)s/data/index'
48 app_instance_uuid = ${app_instance_uuid}
48 app_instance_uuid = ${app_instance_uuid}
49 cut_off_limit = 256000
49 cut_off_limit = 256000
50 force_https = false
50 force_https = false
51 commit_parse_limit = 50
51
52
52 ####################################
53 ####################################
53 ### CELERY CONFIG ####
54 ### CELERY CONFIG ####
@@ -71,7 +72,7 b' celery.result.serialier = json'
71 celeryd.concurrency = 2
72 celeryd.concurrency = 2
72 #celeryd.log.file = celeryd.log
73 #celeryd.log.file = celeryd.log
73 celeryd.log.level = debug
74 celeryd.log.level = debug
74 celeryd.max.tasks.per.child = 3
75 celeryd.max.tasks.per.child = 1
75
76
76 #tasks will never be sent to the queue, but executed locally instead.
77 #tasks will never be sent to the queue, but executed locally instead.
77 celery.always.eager = false
78 celery.always.eager = false
@@ -104,7 +104,7 b' def get_commits_stats(repo_name, ts_min_'
104 repo = get_repo(p)
104 repo = get_repo(p)
105
105
106 skip_date_limit = True
106 skip_date_limit = True
107 parse_limit = 250 #limit for single task changeset parsing optimal for
107 parse_limit = int(config['app_conf'].get('commit_parse_limit'))
108 last_rev = 0
108 last_rev = 0
109 last_cs = None
109 last_cs = None
110 timegetter = itemgetter('time')
110 timegetter = itemgetter('time')
@@ -135,8 +135,9 b' def get_commits_stats(repo_name, ts_min_'
135 lmktime = mktime
135 lmktime = mktime
136
136
137 last_rev = last_rev + 1 if last_rev > 0 else last_rev
137 last_rev = last_rev + 1 if last_rev > 0 else last_rev
138 for rev in repo.revisions[last_rev:last_rev + parse_limit]:
138
139 last_cs = cs = repo.get_changeset(rev)
139 for cs in repo[last_rev:last_rev + parse_limit]:
140 last_cs = cs #remember last parsed changeset
140 k = lmktime([cs.date.timetuple()[0], cs.date.timetuple()[1],
141 k = lmktime([cs.date.timetuple()[0], cs.date.timetuple()[1],
141 cs.date.timetuple()[2], 0, 0, 0, 0, 0, 0])
142 cs.date.timetuple()[2], 0, 0, 0, 0, 0, 0])
142
143
@@ -209,10 +210,9 b' def get_commits_stats(repo_name, ts_min_'
209 log.debug('getting code trending stats')
210 log.debug('getting code trending stats')
210 stats.languages = json.dumps(__get_codes_stats(repo_name))
211 stats.languages = json.dumps(__get_codes_stats(repo_name))
211
212
212 stats.repository = dbrepo
213 stats.stat_on_revision = last_cs.revision
214
215 try:
213 try:
214 stats.repository = dbrepo
215 stats.stat_on_revision = last_cs.revision if last_cs else 0
216 sa.add(stats)
216 sa.add(stats)
217 sa.commit()
217 sa.commit()
218 except:
218 except:
General Comments 0
You need to be logged in to leave comments. Login now