From 3ef061a0d51b79bf2f6e9d846532f39fc5df8daf Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Mon, 4 Dec 2023 15:48:38 -0500 Subject: [PATCH] Drop as_dependencies_interlock as zeiterk doesn't need it Part of the rails 7 upgrade: https://github.com/ManageIQ/manageiq/issues/22052 --- lib/extensions/as_dependencies_interlock.rb | 31 --------------------- 1 file changed, 31 deletions(-) delete mode 100644 lib/extensions/as_dependencies_interlock.rb diff --git a/lib/extensions/as_dependencies_interlock.rb b/lib/extensions/as_dependencies_interlock.rb deleted file mode 100644 index 42be494e50b..00000000000 --- a/lib/extensions/as_dependencies_interlock.rb +++ /dev/null @@ -1,31 +0,0 @@ -module AsDependenciesInterlock - # The classic autoloader needs the ActiveSupport::Dependencies.interlock - # to avoid deadlocks. With zeitwerk, this actually causes deadlocks so - # we only use the interlock with the classic autoloader. - def loading(&block) - if Rails.application.config.autoloader == :zeitwerk - warn_about_zeitwerk_and_interlock - yield - else - super - end - end - - def permit_concurrent_loads(&block) - if Rails.application.config.autoloader == :zeitwerk - warn_about_zeitwerk_and_interlock - yield - else - super - end - end - - def warn_about_zeitwerk_and_interlock - @warn_about_zeitwerk_and_interlock ||= begin - warn ":zeitwerk is the configured autoloader. This patched file should be removed: #{__FILE__} once support for the classic loader is dropped. Additionally remove all uses of AS::Depedencies.interlock." - true - end - end -end - -ActiveSupport::Dependencies.interlock.singleton_class.prepend(AsDependenciesInterlock)