Skip to content

Commit b639746

Browse files
committed
feat(index): add hashAlgorithm and format insert ret val
1 parent 65f6632 commit b639746

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: lib/entry-index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function insert (cache, key, digest, opts) {
3838
const entry = {
3939
key: key,
4040
digest: digest,
41+
hashAlgorithm: opts.hashAlgorithm,
4142
time: +(new Date()),
4243
metadata: opts.metadata
4344
}
@@ -63,7 +64,11 @@ function insert (cache, key, digest, opts) {
6364
})
6465
})
6566
})
66-
)).then(() => fixOwner.chownr(bucket, opts.uid, opts.gid))
67+
)).then(entry => {
68+
return fixOwner.chownr(bucket, opts.uid, opts.gid).then(() => {
69+
return formatEntry(cache, entry)
70+
})
71+
})
6772
}
6873

6974
module.exports.find = find
@@ -173,6 +178,7 @@ function formatEntry (cache, entry) {
173178
return {
174179
key: entry.key,
175180
digest: entry.digest,
181+
hashAlgorithm: entry.hashAlgorithm,
176182
path: contentPath(cache, entry.digest),
177183
time: entry.time,
178184
metadata: entry.metadata

0 commit comments

Comments
 (0)