FEATURE: minimize duration of read-only mode when backing up
This commit is contained in:
parent
ea953c9c0e
commit
dbe72fe26d
|
@ -19,22 +19,25 @@ module Export
|
||||||
|
|
||||||
listen_for_shutdown_signal
|
listen_for_shutdown_signal
|
||||||
|
|
||||||
|
ensure_directory_exists(@tmp_directory)
|
||||||
|
ensure_directory_exists(@archive_directory)
|
||||||
|
|
||||||
|
write_metadata
|
||||||
|
|
||||||
|
### READ-ONLY / START ###
|
||||||
enable_readonly_mode
|
enable_readonly_mode
|
||||||
|
|
||||||
pause_sidekiq
|
pause_sidekiq
|
||||||
wait_for_sidekiq
|
wait_for_sidekiq
|
||||||
|
|
||||||
ensure_directory_exists(@tmp_directory)
|
|
||||||
|
|
||||||
write_metadata
|
|
||||||
|
|
||||||
dump_public_schema
|
dump_public_schema
|
||||||
|
|
||||||
update_dump
|
disable_readonly_mode
|
||||||
|
### READ-ONLY / END ###
|
||||||
|
|
||||||
log "Finalizing backup..."
|
log "Finalizing backup..."
|
||||||
|
|
||||||
ensure_directory_exists(@archive_directory)
|
update_dump
|
||||||
|
|
||||||
create_archive
|
create_archive
|
||||||
|
|
||||||
|
@ -268,7 +271,7 @@ module Export
|
||||||
log "Cleaning stuff up..."
|
log "Cleaning stuff up..."
|
||||||
remove_tmp_directory
|
remove_tmp_directory
|
||||||
unpause_sidekiq
|
unpause_sidekiq
|
||||||
disable_readonly_mode
|
disable_readonly_mode if Discourse.readonly_mode?
|
||||||
mark_export_as_not_running
|
mark_export_as_not_running
|
||||||
log "Finished!"
|
log "Finished!"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue