From: Fabrice Bellingard Date: Mon, 21 May 2012 06:51:18 +0000 (+0200) Subject: SONAR-3145 During migration, access to Sonar is not allowed X-Git-Tag: 3.1~160 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5c49a6904e9f739d862f2291029248d163d5e85f;p=sonarqube.git SONAR-3145 During migration, access to Sonar is not allowed --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb index ba6da3894f4..3b382a1b324 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb @@ -80,7 +80,7 @@ class ApplicationController < ActionController::Base protected def check_database_version - unless DatabaseVersion.uptodate? + unless DatabaseMigrationManager.instance.is_sonar_access_allowed? redirect_to :controller => 'maintenance', :action => 'index' end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/database_migration_manager.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/database_migration_manager.rb index 4f3072cac33..a2b59ea9cfe 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/database_migration_manager.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/database_migration_manager.rb @@ -80,6 +80,10 @@ class DatabaseMigrationManager @status==MIGRATION_FAILED end + def is_sonar_access_allowed? + @status==NO_MIGRATION || @status==MIGRATION_SUCCEEDED + end + def migration_start_time @start_time end