[PATCH 2 of 2] ini: drop setting initial_repo_scan

Thomas De Schampheleire thomas.de_schampheleire at nokia.com
Fri May 4 19:46:30 UTC 2018


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1525463155 -7200
#      Fri May 04 21:45:55 2018 +0200
# Node ID 09210076897c186bfbe442275da9250ef12e644d
# Parent  fbdbd8183187616774d8b5c4940783b9378286b7
ini: drop setting initial_repo_scan

The ini setting 'initial_repo_scan' causes a repository scan on each startup
of Kallithea. The accompanying comment already warns that the feature should
be disabled after the first run to improve startup time.

Now that setup-db is performing the initial repository scan, and considering
that administrators can always request a new scan using 'gearbox repo-scan'
or via the web interface, the 'initial_repo_scan' feature is no longer
considered useful and is removed with this commit.

diff --git a/development.ini b/development.ini
--- a/development.ini
+++ b/development.ini
@@ -98,11 +98,6 @@ i18n.lang =
 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 = false
-initial_repo_scan = true
-
 ## uncomment and set this path to use archive download cache
 archive_cache_dir = %(here)s/tarballcache
 
diff --git a/kallithea/config/app_cfg.py b/kallithea/config/app_cfg.py
--- a/kallithea/config/app_cfg.py
+++ b/kallithea/config/app_cfg.py
@@ -171,10 +171,6 @@ def setup_configuration(app):
 
     check_git_version()
 
-    if str2bool(config.get('initial_repo_scan', True)):
-        repo2db_mapper(ScmModel().repo_scan(repos_path),
-                       remove_obsolete=False, install_git_hooks=False)
-
 
 hooks.register('configure_new_app', setup_configuration)
 
diff --git a/kallithea/lib/paster_commands/template.ini.mako b/kallithea/lib/paster_commands/template.ini.mako
--- a/kallithea/lib/paster_commands/template.ini.mako
+++ b/kallithea/lib/paster_commands/template.ini.mako
@@ -193,10 +193,6 @@ i18n.lang =
 cache_dir = %(here)s/data
 index_dir = %(here)s/data/index
 
-<%text>## perform a full repository scan on each server start, this should be</%text>
-<%text>## set to false after first startup, to allow faster server restarts.</%text>
-initial_repo_scan = false
-
 <%text>## uncomment and set this path to use archive download cache</%text>
 archive_cache_dir = %(here)s/tarballcache
 
diff --git a/scripts/generate-ini.py b/scripts/generate-ini.py
--- a/scripts/generate-ini.py
+++ b/scripts/generate-ini.py
@@ -17,7 +17,6 @@ ini_files = [
                 'host': '0.0.0.0',
             },
             '[app:main]': {
-                'initial_repo_scan': 'true',
                 'debug': 'true',
                 'app_instance_uuid': 'development-not-secret',
                 'beaker.session.secret': 'development-not-secret',


More information about the kallithea-general mailing list