From f3ab4b3c2ed9f7359cd74ea706c690fa6e71d4df Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Tue, 19 Dec 2023 14:33:24 -0500 Subject: [PATCH] Merge pull request #1243 from jrafanie/drop_as_dependencies_interlock_with_classic_autoloader_gone loading is not needed with zeitwerk autoloader (cherry picked from commit 83a495d4f5626bb46535b93bb5952a0764cf355a) --- app/controllers/api/providers_controller.rb | 8 ++------ lib/api/environment.rb | 12 ++++-------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/controllers/api/providers_controller.rb b/app/controllers/api/providers_controller.rb index 0e5fa18664..6341a6e8da 100644 --- a/app/controllers/api/providers_controller.rb +++ b/app/controllers/api/providers_controller.rb @@ -141,15 +141,11 @@ def provider_options(type) end def permitted_subclasses - ActiveSupport::Dependencies.interlock.loading do - ManageIQ::Providers::BaseManager.permitted_subclasses - end + ManageIQ::Providers::BaseManager.permitted_subclasses end def supported_types_for_create - ActiveSupport::Dependencies.interlock.loading do - ExtManagementSystem.supported_types_for_create - end + ExtManagementSystem.supported_types_for_create end def providers_options diff --git a/lib/api/environment.rb b/lib/api/environment.rb index e82902483c..0df075dde8 100644 --- a/lib/api/environment.rb +++ b/lib/api/environment.rb @@ -24,14 +24,10 @@ def self.encrypted_attributes_whitelist def self.time_attributes @time_attributes ||= ApiConfig.collections.each.with_object(Set.new(%w(expires_on))) do |(_, cspec), result| next if cspec[:klass].blank? - klass = nil - - # Ensure we're the only thread trying to autoload classes and their columns - ActiveSupport::Dependencies.interlock.loading do - klass = cspec[:klass].constantize - klass.columns_hash.each do |name, typeobj| - result << name if %w(date datetime).include?(typeobj.type.to_s) - end + + klass = cspec[:klass].constantize + klass.columns_hash.each do |name, typeobj| + result << name if %w(date datetime).include?(typeobj.type.to_s) end end end