Skip to content

Commit e33bc08

Browse files
committed
audit: Timeout audit requests eventually
1 parent 9cb9102 commit e33bc08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/install.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,8 @@ Installer.prototype.printInstalled = function (cb) {
761761
})
762762
}
763763
return Bluebird.try(() => {
764-
return this.auditSubmission && this.auditSubmission.catch(() => null)
764+
if (!this.auditSubmission) return
765+
return Bluebird.resolve(this.auditSubmission).timeout(10000).catch(() => null)
765766
}).then((auditResult) => {
766767
// maybe write audit report w/ hash of pjson & shrinkwrap for later reading by `npm audit`
767768
if (npm.config.get('json')) {

0 commit comments

Comments
 (0)