Skip to content

Commit

Permalink
feat(promise): removed .tap
Browse files Browse the repository at this point in the history
  • Loading branch information
billatnpm authored and isaacs committed Sep 15, 2019
1 parent 0a8cb87 commit 0260f12
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ function verify (cache, opts) {
stats.runTime[label] = end - start
return stats
})
}, {}).tap(stats => {
stats.runTime.total = stats.endTime - stats.startTime
opts.log.silly('verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms`)
})
}, {})
.then((stats) => {
stats.runTime.total = stats.endTime - stats.startTime
opts.log.silly('verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms`)
return stats
})
}

function markStartTime (cache, opts) {
Expand Down Expand Up @@ -101,7 +103,7 @@ function garbageCollect (cache, opts) {
reclaimedSize: 0,
badContentCount: 0,
keptSize: 0
}).tap((stats) => BB.map(files, (f) => {
}).then((stats) => BB.map(files, (f) => {
const split = f.split(/[/\\]/)
const digest = split.slice(split.length - 3).join('')
const algo = split[split.length - 4]
Expand All @@ -128,7 +130,8 @@ function garbageCollect (cache, opts) {
})
})
}
}, { concurrency: opts.concurrency }))
}, { concurrency: opts.concurrency })
.then(() => stats))
})
})
}
Expand Down

0 comments on commit 0260f12

Please sign in to comment.