hiera-router 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiera/backend/router_backend.rb +0 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51e2d2648a4c8bc2feb67c750a4c79cccb026009
|
4
|
+
data.tar.gz: f7608386a2b73208b88a3852c3ea7f3b34a05421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40bf724f9243bbbfd4830fa70d09e86c4462c7f1047fcee7fc0c541c1e7c9e8c98118bcdf832aa0bdfb0850e674b3ebfaa3ed08da4e704ee954cc87453e9742b
|
7
|
+
data.tar.gz: ec17a36277cbd0fbbae5447b5f0441d09cc3a71a8f84c06246c648909af73f199b8f65e13827aa4ea78f3cc3671a91ca7a0d9b9459cad9f955e7769412488b95
|
@@ -21,9 +21,7 @@ class Hiera
|
|
21
21
|
|
22
22
|
def initialize(cache = nil)
|
23
23
|
@cache = cache || Filecache.new
|
24
|
-
@bigcache = {}
|
25
24
|
@backends = {}
|
26
|
-
@cache_time = 60 # Cache all values for 1 minute
|
27
25
|
Hiera.debug("[hiera-router] I'm here!")
|
28
26
|
self.config = Config.config
|
29
27
|
self.config[:hierarchy] = Config[:router][:paths] if Config[:router][:paths] and self.config[:hierarchy].empty?
|
@@ -74,11 +72,6 @@ class Hiera
|
|
74
72
|
key_path = Util.split_key(lookup_key)
|
75
73
|
key = key_path.shift
|
76
74
|
|
77
|
-
cache_key = options.to_s
|
78
|
-
cached_value = @bigcache[cache_key]
|
79
|
-
if cached_value
|
80
|
-
return cached_value[:value] if cached_value[:time] > Time.now - @cache_time
|
81
|
-
end
|
82
75
|
answer = nil
|
83
76
|
strategy = resolution_type.is_a?(Hash) ? :hash : resolution_type
|
84
77
|
|
@@ -127,10 +120,6 @@ class Hiera
|
|
127
120
|
|
128
121
|
answer = Backend.resolve_answer(answer, strategy) unless answer.nil?
|
129
122
|
|
130
|
-
@bigcache[cache_key] = {
|
131
|
-
:value => answer,
|
132
|
-
:time => Time.now,
|
133
|
-
}
|
134
123
|
return answer
|
135
124
|
end
|
136
125
|
|