studiokit-scaffolding-js 4.7.1-alpha.2 → 4.7.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/url.js +5 -6
- package/package.json +1 -1
package/lib/utils/url.js
CHANGED
|
@@ -91,8 +91,8 @@ function fetchText(url, options) {
|
|
|
91
91
|
didFail = false;
|
|
92
92
|
_a.label = 1;
|
|
93
93
|
case 1:
|
|
94
|
+
if (!(tryCount < RETRY_LIMIT && didFail)) return [3 /*break*/, 8];
|
|
94
95
|
didFail = false;
|
|
95
|
-
tryCount++;
|
|
96
96
|
_a.label = 2;
|
|
97
97
|
case 2:
|
|
98
98
|
_a.trys.push([2, 5, , 7]);
|
|
@@ -106,14 +106,13 @@ function fetchText(url, options) {
|
|
|
106
106
|
case 5:
|
|
107
107
|
error_1 = _a.sent();
|
|
108
108
|
didFail = true;
|
|
109
|
-
logger_1.getLogger().error("Failed to fetch " + url + ". attempt: " + tryCount + ", error: " + error_1);
|
|
110
|
-
return [4 /*yield*/, wait(2
|
|
109
|
+
logger_1.getLogger().error("Failed to fetch " + url + ". attempt: " + (tryCount + 1) + ", error: " + error_1);
|
|
110
|
+
return [4 /*yield*/, wait(Math.pow(2, tryCount) * 100)]; // 100, 200, 400...
|
|
111
111
|
case 6:
|
|
112
112
|
_a.sent(); // 100, 200, 400...
|
|
113
|
+
tryCount++;
|
|
113
114
|
return [3 /*break*/, 7];
|
|
114
|
-
case 7:
|
|
115
|
-
if (tryCount < RETRY_LIMIT && didFail) return [3 /*break*/, 1];
|
|
116
|
-
_a.label = 8;
|
|
115
|
+
case 7: return [3 /*break*/, 1];
|
|
117
116
|
case 8: throw new Error("Failed to fetch " + url + " after " + RETRY_LIMIT + " attempts.");
|
|
118
117
|
}
|
|
119
118
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "studiokit-scaffolding-js",
|
|
3
|
-
"version": "4.7.1-alpha.
|
|
3
|
+
"version": "4.7.1-alpha.3",
|
|
4
4
|
"description": "Common scaffolding for Studio apps at Purdue",
|
|
5
5
|
"repository": "https://gitlab.com/purdue-informatics/studiokit/studiokit-scaffolding-js",
|
|
6
6
|
"license": "MIT",
|