On Jul 21, 2008, at 8:37 AM, duritong wrote:

>
> I could observe that yumhelper.py can run quite some time
> and use quite a lot of memory (up to 100MB!) if you're
> using many repositories. As the yumhelper is only needed
> if you use latest as a ensure-keyword it makes no sense
> for people like me letting puppet fetch these details
> always, if you're never going to use latest. Therefor this
> patch changes the behaviour, that the yumhelper is only
> called, if @updates is accessed the first time.
> => lazy loading.

I like the patch, and it's a good idea.

> +    def self.updates
> +      self.fetch_yumlatest unless defined? @updates
> +      @updates
> +    end

Why even set @updates?  Why not just return the hash?  Is that  
instance variable used anywhere else?

I've had lots of problems using instance variables in long-lived  
processes, so it'd be good if we could get rid of this one.  I know  
it's there now, but this seems like a good way to get rid of it.

-- 
The real art of conversation is not only to say the right thing at the
right place but to leave unsaid the wrong thing at the tempting
moment. -- Dorothy Nevill
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to