Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

(FACT-2498) Internal fact loader should only load facts once #420

Merged
merged 10 commits into from
Mar 31, 2020
Prev Previous commit
Next Next commit
(FACT-2498) Refactor skipping of already loaded facts.
  • Loading branch information
Bogdan Irimie committed Mar 31, 2020
commit e7722fdd8f6655048a313a21a2e16fc864e21f27
2 changes: 1 addition & 1 deletion lib/framework/core/fact_loaders/internal_fact_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def load_for_os(operating_system)
fact_name = class_name::FACT_NAME

# if fact is already loaded, skip it
next if @facts.select { |fact| fact.name == fact_name }.any?
next if @facts.any? { |fact| fact.name == fact_name }

type = fact_name.end_with?('.*') ? :legacy : :core
load_fact(fact_name, class_name, type)
Expand Down