diff options
author | Luke Kanies <luke@madstop.com> | 2008-11-11 10:47:32 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-11-11 12:53:37 -0800 |
commit | 14af971bc618d665f481142934b2f612d503823c (patch) | |
tree | 08804f17e7b75110d0ea584583e235c8a4778cd0 /lib | |
parent | 99a0770a30c7c9a1349fd693cda31bdbf2717864 (diff) | |
download | puppet-14af971bc618d665f481142934b2f612d503823c.tar.gz puppet-14af971bc618d665f481142934b2f612d503823c.tar.xz puppet-14af971bc618d665f481142934b2f612d503823c.zip |
Changing the Cacher.invalidate method to Cacher.expire.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/network/http_pool.rb | 2 | ||||
-rw-r--r-- | lib/puppet/util/cacher.rb | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb index 78a35cc15..4b371abe7 100644 --- a/lib/puppet/network/http_pool.rb +++ b/lib/puppet/network/http_pool.rb @@ -28,7 +28,7 @@ module Puppet::Network::HttpPool http_cache.each do |name, connection| connection.finish if connection.started? end - Puppet::Util::Cacher.invalidate + Puppet::Util::Cacher.expire end # Make sure we set the driver up when we read the cert in. diff --git a/lib/puppet/util/cacher.rb b/lib/puppet/util/cacher.rb index 773c02182..139aa3659 100644 --- a/lib/puppet/util/cacher.rb +++ b/lib/puppet/util/cacher.rb @@ -2,11 +2,11 @@ module Puppet::Util::Cacher # It's basically not possible to test that this is set, # but we need to start with a value so that all initial values # start out valid -- that is, everything's valid until the - # first call to 'invalidate'. + # first call to 'expire'. @timestamp = Time.now # Cause all cached values to be considered expired. - def self.invalidate + def self.expire @timestamp = Time.now end @@ -70,6 +70,11 @@ module Puppet::Util::Cacher class Cache attr_accessor :caches, :timestamp + def clear + caches.clear + self.timestamp = Time.now + end + def initialize @caches = {} @timestamp = Time.now @@ -90,8 +95,7 @@ module Puppet::Util::Cacher # clear other cached values, too (if this instance is caching more # than one value). if expired? - caches.clear - self.timestamp = Time.now + clear end # Generate a new value if we don't have one. Use 'include?' here |