forked from External/greenlight
		
	Fixed issues with maintenance mode (#683)
This commit is contained in:
		
				
					committed by
					
						 Jesus Federico
						Jesus Federico
					
				
			
			
				
	
			
			
			
						parent
						
							d1e50f2ef6
						
					
				
				
					commit
					0b64acaecf
				
			| @@ -197,6 +197,6 @@ class ApplicationController < ActionController::Base | |||||||
|   # Manually Handle errors when application is in readonly mode |   # Manually Handle errors when application is in readonly mode | ||||||
|   def handle_readonly_error |   def handle_readonly_error | ||||||
|     flash.clear |     flash.clear | ||||||
|     redirect_to request.referrer, flash: { alert: I18n.t("errors.maintenance.readonly") } |     redirect_to request.referrer || root_path, flash: { alert: I18n.t("errors.maintenance.readonly") } | ||||||
|   end |   end | ||||||
| end | end | ||||||
|   | |||||||
| @@ -87,6 +87,7 @@ module ApplicationHelper | |||||||
|   def allow_greenlight_accounts? |   def allow_greenlight_accounts? | ||||||
|     return Rails.configuration.allow_user_signup unless Rails.configuration.loadbalanced_configuration |     return Rails.configuration.allow_user_signup unless Rails.configuration.loadbalanced_configuration | ||||||
|     return false unless @user_domain && !@user_domain.empty? && Rails.configuration.allow_user_signup |     return false unless @user_domain && !@user_domain.empty? && Rails.configuration.allow_user_signup | ||||||
|  |     return false if @user_domain == "greenlight" | ||||||
|     # Proceed with retrieving the provider info |     # Proceed with retrieving the provider info | ||||||
|     begin |     begin | ||||||
|       provider_info = retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials') |       provider_info = retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials') | ||||||
|   | |||||||
| @@ -9,8 +9,11 @@ if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then | |||||||
| fi | fi | ||||||
|  |  | ||||||
| bundle exec rake db:create | bundle exec rake db:create | ||||||
| if ! bundle exec rake db:migrate ; then |  | ||||||
|   export DB_MIGRATE_FAILED=1 | if [ "$MAINTENANCE_MODE" != "readonly" ] && [ "$MAINTENANCE_MODE" != "full" ]; then | ||||||
|  |   if ! bundle exec rake db:migrate ; then | ||||||
|  |     export DB_MIGRATE_FAILED=1 | ||||||
|  |   fi | ||||||
| fi | fi | ||||||
|  |  | ||||||
| bundle exec rake assets:precompile | bundle exec rake assets:precompile | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user