studiokit-scaffolding-js 4.7.1-alpha.3 → 4.7.1-alpha.4

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.
Files changed (2) hide show
  1. package/lib/utils/url.js +7 -6
  2. package/package.json +1 -1
package/lib/utils/url.js CHANGED
@@ -91,7 +91,7 @@ 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
+ tryCount++;
95
95
  didFail = false;
96
96
  _a.label = 2;
97
97
  case 2:
@@ -106,13 +106,14 @@ 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 + 1) + ", error: " + error_1);
110
- return [4 /*yield*/, wait(Math.pow(2, tryCount) * 100)]; // 100, 200, 400...
109
+ logger_1.getLogger().error("Failed to fetch " + url + ". attempt: " + tryCount + ", error: " + error_1);
110
+ return [4 /*yield*/, wait(Math.pow(2, (tryCount - 1)) * 100)]; // 100, 200, 400, 800, 1600
111
111
  case 6:
112
- _a.sent(); // 100, 200, 400...
113
- tryCount++;
112
+ _a.sent(); // 100, 200, 400, 800, 1600
114
113
  return [3 /*break*/, 7];
115
- case 7: return [3 /*break*/, 1];
114
+ case 7:
115
+ if (tryCount < RETRY_LIMIT && didFail) return [3 /*break*/, 1];
116
+ _a.label = 8;
116
117
  case 8: throw new Error("Failed to fetch " + url + " after " + RETRY_LIMIT + " attempts.");
117
118
  }
118
119
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "studiokit-scaffolding-js",
3
- "version": "4.7.1-alpha.3",
3
+ "version": "4.7.1-alpha.4",
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",