mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 17:27:16 +08:00
DEV: Reduce size of begin-rescue region
Follow-up-to: e3e7905d9ebd86943102917b2ff0bfee32035c01
This commit is contained in:
@ -87,14 +87,15 @@ module TurboTests
|
||||
|
||||
ActiveRecord::Tasks::DatabaseTasks.migrations_paths = ['db/migrate', 'db/post_migrate']
|
||||
|
||||
conn = ActiveRecord::Base.establish_connection(config).connection
|
||||
|
||||
begin
|
||||
conn = ActiveRecord::Base.establish_connection(config).connection
|
||||
ActiveRecord::Migration.check_pending!(conn)
|
||||
rescue ActiveRecord::PendingMigrationError
|
||||
puts "There are pending migrations, run rake parallel:migrate"
|
||||
exit 1
|
||||
ensure
|
||||
conn&.close
|
||||
conn.close
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user