Commit e35b716c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'sh-fix-backup-restore-formatting' into 'master'

Fix formatting of restore from backup text

See merge request gitlab-org/gitlab!41405
parents 68dce53e c5546d9c
...@@ -70,9 +70,9 @@ module Backup ...@@ -70,9 +70,9 @@ module Backup
success = $?.success? && status.success? success = $?.success? && status.success?
if errors.present? if errors.present?
progress.print "------ BEGIN ERRORS -----".color(:yellow) progress.print "------ BEGIN ERRORS -----\n".color(:yellow)
progress.print errors.join.color(:yellow) progress.print errors.join.color(:yellow)
progress.print "------ END ERRORS -------".color(:yellow) progress.print "------ END ERRORS -------\n".color(:yellow)
end end
report_success(success) report_success(success)
...@@ -89,12 +89,12 @@ module Backup ...@@ -89,12 +89,12 @@ module Backup
Open3.popen3(ENV, *cmd) do |stdin, stdout, stderr, thread| Open3.popen3(ENV, *cmd) do |stdin, stdout, stderr, thread|
stdin.binmode stdin.binmode
Thread.new do out_reader = Thread.new do
data = stdout.read data = stdout.read
$stdout.write(data) $stdout.write(data)
end end
Thread.new do err_reader = Thread.new do
until (raw_line = stderr.gets).nil? until (raw_line = stderr.gets).nil?
warn(raw_line) warn(raw_line)
# Recent database dumps will use --if-exists with pg_dump # Recent database dumps will use --if-exists with pg_dump
...@@ -108,8 +108,7 @@ module Backup ...@@ -108,8 +108,7 @@ module Backup
end end
stdin.close stdin.close
[thread, out_reader, err_reader].each(&:join)
thread.join
[thread.value, errors] [thread.value, errors]
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment