diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -45,8 +45,10 @@ static_files = true lang=en cache_dir = %(here)s/data index_dir = %(here)s/data/index +app_instance_uuid = develop cut_off_limit = 256000 force_https = false +commit_parse_limit = 25 #################################### ### CELERY CONFIG #### @@ -70,7 +72,7 @@ celery.result.serialier = json celeryd.concurrency = 2 #celeryd.log.file = celeryd.log celeryd.log.level = debug -celeryd.max.tasks.per.child = 3 +celeryd.max.tasks.per.child = 1 #tasks will never be sent to the queue, but executed locally instead. celery.always.eager = false @@ -78,8 +80,9 @@ celery.always.eager = false #################################### ### BEAKER CACHE #### #################################### -beaker.cache.data_dir=/%(here)s/data/cache/data -beaker.cache.lock_dir=/%(here)s/data/cache/lock +beaker.cache.data_dir=%(here)s/data/cache/data +beaker.cache.lock_dir=%(here)s/data/cache/lock + beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long beaker.cache.super_short_term.type=memory diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -47,6 +47,7 @@ cache_dir = %(here)s/data index_dir = %(here)s/data/index cut_off_limit = 256000 force_https = false +commit_parse_limit = 250 #################################### ### CELERY CONFIG #### @@ -70,7 +71,7 @@ celery.result.serialier = json celeryd.concurrency = 2 #celeryd.log.file = celeryd.log celeryd.log.level = debug -celeryd.max.tasks.per.child = 3 +celeryd.max.tasks.per.child = 1 #tasks will never be sent to the queue, but executed locally instead. celery.always.eager = false diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -48,6 +48,7 @@ index_dir = %(here)s/data/index app_instance_uuid = ${app_instance_uuid} cut_off_limit = 256000 force_https = false +commit_parse_limit = 50 #################################### ### CELERY CONFIG #### @@ -71,7 +72,7 @@ celery.result.serialier = json celeryd.concurrency = 2 #celeryd.log.file = celeryd.log celeryd.log.level = debug -celeryd.max.tasks.per.child = 3 +celeryd.max.tasks.per.child = 1 #tasks will never be sent to the queue, but executed locally instead. celery.always.eager = false diff --git a/rhodecode/lib/celerylib/tasks.py b/rhodecode/lib/celerylib/tasks.py --- a/rhodecode/lib/celerylib/tasks.py +++ b/rhodecode/lib/celerylib/tasks.py @@ -104,7 +104,7 @@ def get_commits_stats(repo_name, ts_min_ repo = get_repo(p) skip_date_limit = True - parse_limit = 250 #limit for single task changeset parsing optimal for + parse_limit = int(config['app_conf'].get('commit_parse_limit')) last_rev = 0 last_cs = None timegetter = itemgetter('time') @@ -135,8 +135,9 @@ def get_commits_stats(repo_name, ts_min_ lmktime = mktime last_rev = last_rev + 1 if last_rev > 0 else last_rev - for rev in repo.revisions[last_rev:last_rev + parse_limit]: - last_cs = cs = repo.get_changeset(rev) + + for cs in repo[last_rev:last_rev + parse_limit]: + last_cs = cs #remember last parsed changeset k = lmktime([cs.date.timetuple()[0], cs.date.timetuple()[1], cs.date.timetuple()[2], 0, 0, 0, 0, 0, 0]) @@ -209,10 +210,9 @@ def get_commits_stats(repo_name, ts_min_ log.debug('getting code trending stats') stats.languages = json.dumps(__get_codes_stats(repo_name)) - stats.repository = dbrepo - stats.stat_on_revision = last_cs.revision - try: + stats.repository = dbrepo + stats.stat_on_revision = last_cs.revision if last_cs else 0 sa.add(stats) sa.commit() except: