• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1var common = require('../common');
2var assert = common.assert;
3var retry = require(common.dir.lib + '/retry');
4
5(function testForeverUsesFirstTimeout() {
6  var operation = retry.operation({
7    retries: 0,
8    minTimeout: 100,
9    maxTimeout: 100,
10    forever: true
11  });
12
13  operation.attempt(function(numAttempt) {
14    console.log('>numAttempt', numAttempt);
15    var err = new Error("foo");
16    if (numAttempt == 10) {
17      operation.stop();
18    }
19
20    if (operation.retry(err)) {
21      return;
22    }
23  });
24})();
25