FIX: Sometimes not all output of psql was logged during restores

There was a race condition which could prevent Discourse from logging the last couple of lines of output from psql.
This commit is contained in:
Gerhard Schlager 2020-06-30 16:52:37 +02:00
parent c0b37aa9ef
commit fc8e842773
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ module BackupRestore
log_thread = Thread.new do
RailsMultisite::ConnectionManagement::establish_connection(db: @current_db)
while psql_running
while psql_running || !logs.empty?
message = logs.pop.strip
log(message) if message.present?
end