mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 13:46:28 +08:00
restorer: clarify logging
This commit is contained in:
parent
e2f6d8b5ca
commit
6691a400da
|
@ -41,6 +41,7 @@ module BackupRestore
|
||||||
extract_dump
|
extract_dump
|
||||||
|
|
||||||
if !can_restore_into_different_schema?
|
if !can_restore_into_different_schema?
|
||||||
|
log "Cannot restore into different schema, restoring in-place"
|
||||||
enable_readonly_mode
|
enable_readonly_mode
|
||||||
|
|
||||||
pause_sidekiq
|
pause_sidekiq
|
||||||
|
@ -56,6 +57,7 @@ module BackupRestore
|
||||||
|
|
||||||
disable_readonly_mode
|
disable_readonly_mode
|
||||||
else
|
else
|
||||||
|
log "Restoring into 'backup' schema"
|
||||||
restore_dump
|
restore_dump
|
||||||
enable_readonly_mode
|
enable_readonly_mode
|
||||||
|
|
||||||
|
@ -193,10 +195,9 @@ module BackupRestore
|
||||||
end
|
end
|
||||||
|
|
||||||
def extract_metadata
|
def extract_metadata
|
||||||
log "Extracting metadata file..."
|
|
||||||
|
|
||||||
@metadata =
|
@metadata =
|
||||||
if system('tar', '--list', '--file', @tar_filename, BackupRestore::METADATA_FILE)
|
if system('tar', '--list', '--file', @tar_filename, BackupRestore::METADATA_FILE)
|
||||||
|
log "Extracting metadata file..."
|
||||||
FileUtils.cd(@tmp_directory) do
|
FileUtils.cd(@tmp_directory) do
|
||||||
Discourse::Utils.execute_command(
|
Discourse::Utils.execute_command(
|
||||||
'tar', '--extract', '--file', @tar_filename, BackupRestore::METADATA_FILE,
|
'tar', '--extract', '--file', @tar_filename, BackupRestore::METADATA_FILE,
|
||||||
|
@ -208,6 +209,7 @@ module BackupRestore
|
||||||
raise "Failed to load metadata file." if !data
|
raise "Failed to load metadata file." if !data
|
||||||
data
|
data
|
||||||
else
|
else
|
||||||
|
log "No metadata file to extract."
|
||||||
if @filename =~ /-#{BackupRestore::VERSION_PREFIX}(\d{14})/
|
if @filename =~ /-#{BackupRestore::VERSION_PREFIX}(\d{14})/
|
||||||
{ "version" => Regexp.last_match[1].to_i }
|
{ "version" => Regexp.last_match[1].to_i }
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user