From 4240808c062bc63508b22572e3d793cd86fe9478 Mon Sep 17 00:00:00 2001 From: petersirka Date: Mon, 2 Dec 2024 09:41:17 +0100 Subject: [PATCH] Added `opt.retry()` method in to the `API` evaluation. --- api.js | 12 +++++++++++- changelog.txt | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/api.js b/api.js index ddbcb26..916bedc 100644 --- a/api.js +++ b/api.js @@ -36,9 +36,19 @@ exports.newapi = function(type, callback) { }; +function APIOptions(t) { + t.api = t; + t.retries = 0; +} + +APIOptions.prototype.retry = function() { + this.retries++; + setImmediate(execapi, this.api); +}; + function APICall() { var t = this; - t.options = {}; + t.options = new APIOptions(t); } const APICallProto = APICall.prototype; diff --git a/changelog.txt b/changelog.txt index 6dbf9e5..657a6c9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,8 @@ 0.0.8 ======================== +- added `opt.retry()` method in to the `API` evaluation + ======================== 0.0.7 ========================