changeset 3778:88f11b5eb6db beta

added initial_repo_scan flag for controll if repo scaning should be performed on every startup. There's always paster repo-scan or repo scann triggered from admin pannel
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 22 Apr 2013 14:20:14 +0200
parents 0b6982223baa
children e61a656b44bd
files development.ini production.ini rhodecode/config/deployment.ini_tmpl rhodecode/config/environment.py test.ini
diffstat 5 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/development.ini	Mon Apr 22 14:11:53 2013 +0200
+++ b/development.ini	Mon Apr 22 14:20:14 2013 +0200
@@ -68,6 +68,10 @@
 cache_dir = %(here)s/data
 index_dir = %(here)s/data/index
 
+## perform a full repository scan on each server start, this should be
+## set to false after first startup, to allow faster server restarts.
+initial_repo_scan = true
+
 ## uncomment and set this path to use archive download cache
 #archive_cache_dir = /tmp/tarballcache
 
--- a/production.ini	Mon Apr 22 14:11:53 2013 +0200
+++ b/production.ini	Mon Apr 22 14:20:14 2013 +0200
@@ -68,6 +68,10 @@
 cache_dir = %(here)s/data
 index_dir = %(here)s/data/index
 
+## perform a full repository scan on each server start, this should be
+## set to false after first startup, to allow faster server restarts.
+initial_repo_scan = true
+
 ## uncomment and set this path to use archive download cache
 #archive_cache_dir = /tmp/tarballcache
 
--- a/rhodecode/config/deployment.ini_tmpl	Mon Apr 22 14:11:53 2013 +0200
+++ b/rhodecode/config/deployment.ini_tmpl	Mon Apr 22 14:20:14 2013 +0200
@@ -68,6 +68,10 @@
 cache_dir = %(here)s/data
 index_dir = %(here)s/data/index
 
+## perform a full repository scan on each server start, this should be
+## set to false after first startup, to allow faster server restarts.
+initial_repo_scan = true
+
 ## uncomment and set this path to use archive download cache
 #archive_cache_dir = /tmp/tarballcache
 
--- a/rhodecode/config/environment.py	Mon Apr 22 14:11:53 2013 +0200
+++ b/rhodecode/config/environment.py	Mon Apr 22 14:20:14 2013 +0200
@@ -96,8 +96,9 @@
     init_model(sa_engine_db1)
 
     repos_path = make_ui('db').configitems('paths')[0][1]
-    repo2db_mapper(ScmModel().repo_scan(repos_path),
-                   remove_obsolete=False, install_git_hook=False)
+    if str2bool(config.get('initial_repo_scan', True)):
+        repo2db_mapper(ScmModel().repo_scan(repos_path),
+                       remove_obsolete=False, install_git_hook=False)
     set_available_permissions(config)
     config['base_path'] = repos_path
     set_rhodecode_config(config)
--- a/test.ini	Mon Apr 22 14:11:53 2013 +0200
+++ b/test.ini	Mon Apr 22 14:20:14 2013 +0200
@@ -68,6 +68,10 @@
 cache_dir = /tmp/rc/data
 index_dir = /tmp/rc/index
 
+## perform a full repository scan on each server start, this should be
+## set to false after first startup, to allow faster server restarts.
+initial_repo_scan = true
+
 ## uncomment and set this path to use archive download cache
 #archive_cache_dir = /tmp/tarballcache