| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This commit should have no functional effect.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
This method name clashed with Puppet::Indirector::Envelope#expired?,
and its name wasn't actually very appropriate.
The new method name is 'dependent_data_expired?'.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
Previously you had to have an Expirer, but now
you can declare a TTL for a cached attribute
and it will be expired automatically when the
cached value is older than the ttl.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
| |
This works for those classes like Puppet::Type that use an expirer that isn't
always present (they use their catalog as an expirer).
The behaviour is now that if there is no expirer, expire() is a no-op and all
data is considered expired all the time, so it's always fresh.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
source and metadata.
As hoped, this drastically simplifies the code around retaining
this data.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
| |
If there's no expirer, then the value is regenerated every
time.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously you could dynamically use cached values, but the new interface
requires a single static declaration of the attribute:
cached_attr(:myattr) { my_init_code() }
This is cleaner, because it makes it easy to turn the code into an init method
and generally makes the whole thing easier to think about.
Most of this commit is going through the different classes that already using the
Caching engine.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basically, the first generated value was always
considered expired the next time it was asked for.
The fix was to create an initial timestamp in the Cacher
module, thus providing a floor for validity.
This is definitely a murky bug, and is especially hard to
test.
Also refactoring the internals just a bit.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
| |
This provides a single, global bit for determining whether
a given piece of cached data is still valid.
|
|
I keep having issues with integration tests keeping
cached values around, and this module should hopefully
give us a single place to invalidate all caches, thus
making testing this much easier.
|