diff --git a/app/assets/javascripts/discourse/initializers/1_init_message_bus.js b/app/assets/javascripts/discourse/initializers/1_init_message_bus.js index 59b7bf130cb..bce4c75cb92 100644 --- a/app/assets/javascripts/discourse/initializers/1_init_message_bus.js +++ b/app/assets/javascripts/discourse/initializers/1_init_message_bus.js @@ -30,8 +30,13 @@ Discourse.addInitializer(function() { Discourse.MessageBus.subscribe("/global/read-only", function (enabled) { Discourse.set("isReadOnly", enabled); - if (enabled && !Discourse.User.currentProp("hideReadOnlyAlert")) { - bootbox.alert(I18n.t("read_only_mode.enabled")); + if (enabled) { + if (!Discourse.User.currentProp("hideReadOnlyAlert")) { + bootbox.alert(I18n.t("read_only_mode.enabled")); + } + } else { + // force a reload + document.location.reload(); } }); diff --git a/lib/backup_restore.rb b/lib/backup_restore.rb index 5d452168625..c65349c75c9 100644 --- a/lib/backup_restore.rb +++ b/lib/backup_restore.rb @@ -149,9 +149,13 @@ module BackupRestore end def self.after_fork + # reconnect to redis $redis.client.reconnect + # reconnect the rails cache (uses redis) Rails.cache.reconnect + # tells the message we've forked MessageBus.after_fork + # /!\ HACK /!\ force sidekiq to create a new connection to redis Sidekiq.instance_variable_set(:@redis, nil) end diff --git a/lib/import/importer.rb b/lib/import/importer.rb index 611edda2130..6994047884b 100644 --- a/lib/import/importer.rb +++ b/lib/import/importer.rb @@ -38,17 +38,13 @@ module Import validate_metadata extract_dump - restore_dump - #----------- CRITICAL -------------- switch_schema! - #----------- CRITICAL -------------- - log "Finalizing restore..." + # TOFIX: MessageBus is busted... migrate_database - reconnect_database extract_uploads @@ -268,10 +264,10 @@ module Import def rollback log "Trying to rollback..." if BackupRestore.can_rollback? - log "Rolling back to previous working state..." + log "Rolling back..." BackupRestore.rename_schema("backup", "public") else - log "No backup schema was created yet!" + log "There was no need to rollback" end end