DEV: Only demux migration stdout if running concurrently (#16895)
This feature only was only demuxing stdout, not stderr. That means that stdout and stderr output appears out-of-order, and makes debugging migrations very confusing. In future we may want to add stderr support to the demuxing. But right now, the concurrency variable is hard-coded to 1. Therefore the easiest fix is to bypass the demuxing.
This commit is contained in:
parent
eef17318c3
commit
115fe90bff
|
@ -124,8 +124,10 @@ task 'multisite:migrate' => ['db:load_config', 'environment', 'set_locale'] do |
|
||||||
|
|
||||||
exceptions = Queue.new
|
exceptions = Queue.new
|
||||||
|
|
||||||
old_stdout = $stdout
|
if concurrency > 1
|
||||||
$stdout = StdOutDemux.new($stdout)
|
old_stdout = $stdout
|
||||||
|
$stdout = StdOutDemux.new($stdout)
|
||||||
|
end
|
||||||
|
|
||||||
SeedFu.quiet = true
|
SeedFu.quiet = true
|
||||||
|
|
||||||
|
@ -151,7 +153,7 @@ task 'multisite:migrate' => ['db:load_config', 'environment', 'set_locale'] do |
|
||||||
exceptions << [db, e]
|
exceptions << [db, e]
|
||||||
ensure
|
ensure
|
||||||
begin
|
begin
|
||||||
$stdout.finish_chunk
|
$stdout.finish_chunk if concurrency > 1
|
||||||
rescue => ex
|
rescue => ex
|
||||||
STDERR.puts ex.inspect
|
STDERR.puts ex.inspect
|
||||||
STDERR.puts ex.backtrace
|
STDERR.puts ex.backtrace
|
||||||
|
@ -198,7 +200,9 @@ task 'multisite:migrate' => ['db:load_config', 'environment', 'set_locale'] do |
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
$stdout = old_stdout
|
if concurrency > 1
|
||||||
|
$stdout = old_stdout
|
||||||
|
end
|
||||||
check_exceptions(exceptions)
|
check_exceptions(exceptions)
|
||||||
|
|
||||||
Rake::Task['db:_dump'].invoke
|
Rake::Task['db:_dump'].invoke
|
||||||
|
|
Loading…
Reference in New Issue