Skip to content

Commit

Permalink
Fixed issues with maintenance mode (bigbluebutton#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad authored and jfederico committed Jul 23, 2019
1 parent d1e50f2 commit 0b64aca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,6 @@ def handle_bigbluebutton_error
# Manually Handle errors when application is in readonly mode
def handle_readonly_error
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
1 change: 1 addition & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def markdown(text)
def allow_greenlight_accounts?
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 if @user_domain == "greenlight"
# Proceed with retrieving the provider info
begin
provider_info = retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials')
Expand Down
7 changes: 5 additions & 2 deletions bin/start
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
fi

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

bundle exec rake assets:precompile
Expand Down

0 comments on commit 0b64aca

Please sign in to comment.