Add basic "post resource publish support"

Fixes #7146
This commit is contained in:
Bjørn Erik Pedersen 2020-02-25 21:40:02 +01:00
parent 8568928aa8
commit 2f721f8ec6
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
18 changed files with 619 additions and 36 deletions

View file

@ -296,9 +296,7 @@ func (r *resourceAdapter) publish() {
}
func (r *resourceAdapter) transform(publish, setContent bool) error {
cache := r.spec.ResourceCache
func (r *resourceAdapter) TransformationKey() string {
// Files with a suffix will be stored in cache (both on disk and in memory)
// partitioned by their suffix.
var key string
@ -307,8 +305,13 @@ func (r *resourceAdapter) transform(publish, setContent bool) error {
}
base := ResourceCacheKey(r.target.Key())
return r.spec.ResourceCache.cleanKey(base) + "_" + helpers.MD5String(key)
}
key = cache.cleanKey(base) + "_" + helpers.MD5String(key)
func (r *resourceAdapter) transform(publish, setContent bool) error {
cache := r.spec.ResourceCache
key := r.TransformationKey()
cached, found := cache.get(key)