Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
feat(index): add hashAlgorithm and format insert ret val
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 2, 2017
1 parent 65f6632 commit b639746
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/entry-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b639746

Please sign in to comment.