Commit e922ba0f authored by Jacob Burroughs's avatar Jacob Burroughs Committed by SaltNPepa
Browse files

Don't expect conneciton_pool.current_pool to exist

current_pool was an old switchman special that isn't needed on rails 6.1+

fixes CANVAS-HWDH

Change-Id: I98c60154b5a572669adeaada5e8cfe8dc1347033
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287731

Reviewed-by: default avatarAaron Ogata <aogata@instructure.com>
Tested-by: default avatarService Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
parent f8e9fdc3
......@@ -45,7 +45,13 @@ module Auditors::ActiveRecord
end
log "*" * 80
end
ActiveRecord::Base.connection_pool.current_pool.disconnect! unless Rails.env.test?
unless Rails.env.test?
if CANVAS_RAILS6_0
ActiveRecord::Base.connection_pool.current_pool.disconnect!
else
ActiveRecord::Base.connection_pool.disconnect!
end
end
end
end
end
......
......@@ -22,7 +22,13 @@ module Messages
log "Done. Bye!"
log "*" * 80
ActiveRecord::Base.connection_pool.current_pool.disconnect! unless Rails.env.test?
unless Rails.env.test?
if CANVAS_RAILS6_0
ActiveRecord::Base.connection_pool.current_pool.disconnect!
else
ActiveRecord::Base.connection_pool.disconnect!
end
end
end
end
end
......
......@@ -38,7 +38,13 @@ class Quizzes::QuizSubmissionEventPartitioner
log "Done. Bye!"
log "*" * 80
ActiveRecord::Base.connection_pool.current_pool.disconnect! unless in_migration || Rails.env.test?
unless in_migration || Rails.env.test?
if CANVAS_RAILS6_0
ActiveRecord::Base.connection_pool.current_pool.disconnect!
else
ActiveRecord::Base.connection_pool.disconnect!
end
end
end
end
end
......
......@@ -36,7 +36,13 @@ class SimplyVersioned::Partitioner
log "Done. Bye!"
log "*" * 80
ActiveRecord::Base.connection_pool.current_pool.disconnect! unless Rails.env.test?
unless Rails.env.test?
if CANVAS_RAILS6_0
ActiveRecord::Base.connection_pool.current_pool.disconnect!
else
ActiveRecord::Base.connection_pool.disconnect!
end
end
end
end
end
......
......@@ -399,7 +399,13 @@ class StreamItem < ActiveRecord::Base
Shard.current.database_server.unguard do
StreamItem.vacuum
StreamItemInstance.vacuum
ActiveRecord::Base.connection_pool.current_pool.disconnect! unless Rails.env.test?
unless Rails.env.test?
if CANVAS_RAILS6_0
ActiveRecord::Base.connection_pool.current_pool.disconnect!
else
ActiveRecord::Base.connection_pool.disconnect!
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