]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/attempt.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / npm-registry-client / lib / attempt.js
1 var retry = require('retry')
2
3 module.exports = attempt
4
5 function attempt (cb) {
6   // Tuned to spread 3 attempts over about a minute.
7   // See formula at <https://github.com/tim-kos/node-retry>.
8   var operation = retry.operation(this.config.retry)
9
10   var client = this
11   operation.attempt(function (currentAttempt) {
12     client.log.info(
13       'attempt',
14       'registry request try #' + currentAttempt +
15         ' at ' + (new Date()).toLocaleTimeString()
16     )
17
18     cb(operation)
19   })
20 }