diff --git a/lib/entry-index.js b/lib/entry-index.js index bb7bb89..dd67ce9 100644 --- a/lib/entry-index.js +++ b/lib/entry-index.js @@ -38,6 +38,7 @@ function insert (cache, key, digest, opts) { const entry = { key: key, digest: digest, + hashAlgorithm: opts.hashAlgorithm, time: +(new Date()), metadata: opts.metadata } @@ -63,7 +64,11 @@ function insert (cache, key, digest, opts) { }) }) }) - )).then(() => fixOwner.chownr(bucket, opts.uid, opts.gid)) + )).then(entry => { + return fixOwner.chownr(bucket, opts.uid, opts.gid).then(() => { + return formatEntry(cache, entry) + }) + }) } module.exports.find = find @@ -173,6 +178,7 @@ function formatEntry (cache, entry) { return { key: entry.key, digest: entry.digest, + hashAlgorithm: entry.hashAlgorithm, path: contentPath(cache, entry.digest), time: entry.time, metadata: entry.metadata