-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are going in the wrong direction with the @fact_list and @semaphore. They shouldn't be tampered with in the resolvers. They should exist only in the BaseResolver. BaseResolver should be like a template, for what resolvers should do, and each resolver would implement just the post_resolve method. Caching, logging and synchronising should be dealt with in just ONE PLACE, in the BaseResolver.
@@ -30,14 +30,13 @@ class SystemProfiler < BaseResolver | |||
|
|||
@log = Facter::Log.new(self) | |||
@semaphore = Mutex.new | |||
@fact_list = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other resolvers you have @fact_list ||= {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @fact_list
is initialise on class creation, there is no need for ||=
@@ -6,7 +6,7 @@ module Macosx | |||
class Processors < BaseResolver | |||
@log = Facter::Log.new(self) | |||
@semaphore = Mutex.new | |||
@fact_list ||= {} | |||
@fact_list = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other resolvers you have @fact_list ||= {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @fact_list
is initialise on class creation, there is no need for ||=
@@ -4,12 +4,13 @@ module Facter | |||
module Resolvers | |||
class NetworkingLinux < BaseResolver | |||
@semaphore = Mutex.new | |||
@fact_list ||= {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be @fact_list = {}
as in other resolvers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@Filipovici-Andrei |
No description provided.