node/deps/npm/node_modules/npm-registry-client/lib/attempt.js
Forrest L Norvell e79ccee168 npm: upgrade to v2.1.18
PR-URL: https://github.com/iojs/io.js/pull/266
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-08 23:49:03 +01:00

18 lines
475 B
JavaScript

var retry = require("retry")
module.exports = attempt
function attempt(cb) {
// Tuned to spread 3 attempts over about a minute.
// See formula at <https://github.com/tim-kos/node-retry>.
var operation = retry.operation(this.config.retry)
var client = this
operation.attempt(function (currentAttempt) {
client.log.info("attempt", "registry request try #"+currentAttempt+
" at "+(new Date()).toLocaleTimeString())
cb(operation)
})
}