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