"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm-registry-client/lib/attempt.js" (8 Mar 2017, 487 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    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 }