summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/autoload/file_cache.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-05-16 00:08:35 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-05-20 18:29:04 +1000
commit138f19fc6e7bb1d8ebf305decaa045c53787297c (patch)
tree00cb8da45f0ff7b12fede738b7df9e045a1583a9 /lib/puppet/util/autoload/file_cache.rb
parent415553e9485d7ba3ed867033ac9c3315107d3c92 (diff)
downloadpuppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.tar.gz
puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.tar.xz
puppet-138f19fc6e7bb1d8ebf305decaa045c53787297c.zip
Caching whether named autoloaded files are missing
This is the big win, because it causes us to just skip the whole loading infrastructure, including skipping looking through the modulepath. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/util/autoload/file_cache.rb')
-rw-r--r--lib/puppet/util/autoload/file_cache.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/puppet/util/autoload/file_cache.rb b/lib/puppet/util/autoload/file_cache.rb
index 6de525a8d..12400f620 100644
--- a/lib/puppet/util/autoload/file_cache.rb
+++ b/lib/puppet/util/autoload/file_cache.rb
@@ -79,6 +79,20 @@ module Puppet::Util::Autoload::FileCache
missing_files[path] = Time.now
end
+ def named_file_missing?(name)
+ @named_files ||= {}
+ if time = @named_files[name] and ! data_expired?(time)
+ return true
+ end
+ false
+ end
+
+ def named_file_is_missing(name)
+ @named_files ||= {}
+ @named_files[name] = Time.now
+ false
+ end
+
private
def cached_data?(path, type = nil)