Completely remove read only mode during backups (#9279)

Completely remove read only mode during backups (#9279)

diff --git a/lib/backup_restore/backuper.rb b/lib/backup_restore/backuper.rb
index 0ae246d..ae7cee8 100644
--- a/lib/backup_restore/backuper.rb
+++ b/lib/backup_restore/backuper.rb
@@ -34,9 +34,6 @@ module BackupRestore
 
       update_metadata
 
-      ### READ-ONLY / START ###
-      enable_readonly_mode
-
       begin
         pause_sidekiq
         wait_for_sidekiq
@@ -45,9 +42,6 @@ module BackupRestore
         unpause_sidekiq
       end
 
-      disable_readonly_mode
-      ### READ-ONLY / END ###
-
       log "Finalizing backup..."
 
       @with_uploads ? create_archive : move_dump_backup
@@ -106,7 +100,6 @@ module BackupRestore
         end
 
       @logs = []
-      @readonly_mode_was_enabled = Discourse.readonly_mode?
     end
 
     def listen_for_shutdown_signal
@@ -134,12 +127,6 @@ module BackupRestore
       BackupMetadata.create!(name: "multisite", value: Rails.configuration.multisite)
     end
 
-    def enable_readonly_mode
-      return if @readonly_mode_was_enabled
-      log "Enabling readonly mode..."
-      Discourse.enable_readonly_mode
-    end
-
     def pause_sidekiq
       log "Pausing sidekiq..."
       Sidekiq.pause!
@@ -364,7 +351,6 @@ module BackupRestore
       log "Cleaning stuff up..."
       delete_uploaded_archive
       remove_tar_leftovers
-      disable_readonly_mode if Discourse.readonly_mode?
       mark_backup_as_not_running
       refresh_disk_space
     end
@@ -411,14 +397,6 @@ module BackupRestore
       log "Something went wrong while unpausing Sidekiq.", ex
     end
 
-    def disable_readonly_mode
-      return if @readonly_mode_was_enabled
-      log "Disabling readonly mode..."
-      Discourse.disable_readonly_mode
-    rescue => ex
-      log "Something went wrong while disabling readonly mode.", ex
-    end
-
     def mark_backup_as_not_running
       log "Marking backup as finished..."
       BackupRestore.mark_as_not_running!

GitHub sha: 57321b90

This commit appears in #9279 which was approved by gschlager. It was merged by romanrizzi.