From 6555fb80fdd8f6a5d201efadec3189d1244830a0 Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Tue, 1 Mar 2022 22:05:25 +0100 Subject: Izbrisala bin, obj i node-modules. --- .../Front/node_modules/retry/example/dns.js | 31 ----------------- .../Front/node_modules/retry/example/stop.js | 40 ---------------------- 2 files changed, 71 deletions(-) delete mode 100644 sandbox/testAppNevena/Front/node_modules/retry/example/dns.js delete mode 100644 sandbox/testAppNevena/Front/node_modules/retry/example/stop.js (limited to 'sandbox/testAppNevena/Front/node_modules/retry/example') diff --git a/sandbox/testAppNevena/Front/node_modules/retry/example/dns.js b/sandbox/testAppNevena/Front/node_modules/retry/example/dns.js deleted file mode 100644 index 446729b6..00000000 --- a/sandbox/testAppNevena/Front/node_modules/retry/example/dns.js +++ /dev/null @@ -1,31 +0,0 @@ -var dns = require('dns'); -var retry = require('../lib/retry'); - -function faultTolerantResolve(address, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, errors, addresses) { - console.warn('err:'); - console.log(err); - - console.warn('addresses:'); - console.log(addresses); -}); \ No newline at end of file diff --git a/sandbox/testAppNevena/Front/node_modules/retry/example/stop.js b/sandbox/testAppNevena/Front/node_modules/retry/example/stop.js deleted file mode 100644 index e1ceafee..00000000 --- a/sandbox/testAppNevena/Front/node_modules/retry/example/stop.js +++ /dev/null @@ -1,40 +0,0 @@ -var retry = require('../lib/retry'); - -function attemptAsyncOperation(someInput, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - failingAsyncOperation(someInput, function(err, result) { - - if (err && err.message === 'A fatal error') { - operation.stop(); - return cb(err); - } - - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), result); - }); - }); -} - -attemptAsyncOperation('test input', function(err, errors, result) { - console.warn('err:'); - console.log(err); - - console.warn('result:'); - console.log(result); -}); - -function failingAsyncOperation(input, cb) { - return setImmediate(cb.bind(null, new Error('A fatal error'))); -} -- cgit v1.2.3