Skip to content

Commit

Permalink
Don't eager load a class needing qpid_proton loaded at load time
Browse files Browse the repository at this point in the history
This class can't be eager loaded because not all pratforms install qpid_proton
and we need qpid_proton's class at load time.  We can't install qpid_proton on mac
but also don't want to install qpid's dependencies in CI in various providers, core,
etc.
  • Loading branch information
jrafanie committed Oct 27, 2023
1 parent 8f967d2 commit dd2a199
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions config/initializers/zeitwerk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
Rails.autoloaders.main.collapse(Rails.root.join("lib/ansible/runner/credential"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/pdf_generator"))

# requires qpid, which is an optional dependency because LOL mac
if RUBY_PLATFORM.include?("darwin")
message_handler_path = Pathname.new(Vmdb::Plugins.paths[ManageIQ::Providers::Nuage::Engine]).join("app/models/manageiq/providers/nuage/network_manager/event_catcher/messaging_handler.rb")
Rails.autoloaders.main.ignore(message_handler_path)
end
# The following file should not be eager loaded as it depends on being installed, which isn't possible on macs and isn't done by default
# in ci for other plugins, core, etc.
message_handler_path = Pathname.new(Vmdb::Plugins.paths[ManageIQ::Providers::Nuage::Engine]).join("app/models/manageiq/providers/nuage/network_manager/event_catcher/messaging_handler.rb")
Rails.autoloaders.main.ignore(message_handler_path)
end

0 comments on commit dd2a199

Please sign in to comment.