mirror of
https://github.com/nick-fields/retry.git
synced 2026-02-09 14:48:02 +00:00
patch: update typescript to latest (#85)
This commit is contained in:
76
dist/index.js
vendored
76
dist/index.js
vendored
@@ -635,15 +635,15 @@ var util_1 = __webpack_require__(322);
|
|||||||
var TIMEOUT_MINUTES = getInputNumber('timeout_minutes', false);
|
var TIMEOUT_MINUTES = getInputNumber('timeout_minutes', false);
|
||||||
var TIMEOUT_SECONDS = getInputNumber('timeout_seconds', false);
|
var TIMEOUT_SECONDS = getInputNumber('timeout_seconds', false);
|
||||||
var MAX_ATTEMPTS = getInputNumber('max_attempts', true) || 3;
|
var MAX_ATTEMPTS = getInputNumber('max_attempts', true) || 3;
|
||||||
var COMMAND = core_1.getInput('command', { required: true });
|
var COMMAND = (0, core_1.getInput)('command', { required: true });
|
||||||
var RETRY_WAIT_SECONDS = getInputNumber('retry_wait_seconds', false) || 10;
|
var RETRY_WAIT_SECONDS = getInputNumber('retry_wait_seconds', false) || 10;
|
||||||
var SHELL = core_1.getInput('shell');
|
var SHELL = (0, core_1.getInput)('shell');
|
||||||
var POLLING_INTERVAL_SECONDS = getInputNumber('polling_interval_seconds', false) || 1;
|
var POLLING_INTERVAL_SECONDS = getInputNumber('polling_interval_seconds', false) || 1;
|
||||||
var RETRY_ON = core_1.getInput('retry_on') || 'any';
|
var RETRY_ON = (0, core_1.getInput)('retry_on') || 'any';
|
||||||
var WARNING_ON_RETRY = core_1.getInput('warning_on_retry').toLowerCase() === 'true';
|
var WARNING_ON_RETRY = (0, core_1.getInput)('warning_on_retry').toLowerCase() === 'true';
|
||||||
var ON_RETRY_COMMAND = core_1.getInput('on_retry_command');
|
var ON_RETRY_COMMAND = (0, core_1.getInput)('on_retry_command');
|
||||||
var CONTINUE_ON_ERROR = getInputBoolean('continue_on_error');
|
var CONTINUE_ON_ERROR = getInputBoolean('continue_on_error');
|
||||||
var NEW_COMMAND_ON_RETRY = core_1.getInput('new_command_on_retry');
|
var NEW_COMMAND_ON_RETRY = (0, core_1.getInput)('new_command_on_retry');
|
||||||
var RETRY_ON_EXIT_CODE = getInputNumber('retry_on_exit_code', false);
|
var RETRY_ON_EXIT_CODE = getInputNumber('retry_on_exit_code', false);
|
||||||
var OS = process.platform;
|
var OS = process.platform;
|
||||||
var OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts';
|
var OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts';
|
||||||
@@ -652,21 +652,21 @@ var OUTPUT_EXIT_ERROR_KEY = 'exit_error';
|
|||||||
var exit;
|
var exit;
|
||||||
var done;
|
var done;
|
||||||
function getInputNumber(id, required) {
|
function getInputNumber(id, required) {
|
||||||
var input = core_1.getInput(id, { required: required });
|
var input = (0, core_1.getInput)(id, { required: required });
|
||||||
var num = Number.parseInt(input);
|
var num = Number.parseInt(input);
|
||||||
// empty is ok
|
// empty is ok
|
||||||
if (!input && !required) {
|
if (!input && !required) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Number.isInteger(num)) {
|
if (!Number.isInteger(num)) {
|
||||||
throw "Input " + id + " only accepts numbers. Received " + input;
|
throw "Input ".concat(id, " only accepts numbers. Received ").concat(input);
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
function getInputBoolean(id) {
|
function getInputBoolean(id) {
|
||||||
var input = core_1.getInput(id);
|
var input = (0, core_1.getInput)(id);
|
||||||
if (!['true', 'false'].includes(input.toLowerCase())) {
|
if (!['true', 'false'].includes(input.toLowerCase())) {
|
||||||
throw "Input " + id + " only accepts boolean values. Received " + input;
|
throw "Input ".concat(id, " only accepts boolean values. Received ").concat(input);
|
||||||
}
|
}
|
||||||
return input.toLowerCase() === 'true';
|
return input.toLowerCase() === 'true';
|
||||||
}
|
}
|
||||||
@@ -677,11 +677,11 @@ function retryWait() {
|
|||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
waitStart = Date.now();
|
waitStart = Date.now();
|
||||||
return [4 /*yield*/, util_1.wait(milliseconds_1.default.seconds(RETRY_WAIT_SECONDS))];
|
return [4 /*yield*/, (0, util_1.wait)(milliseconds_1.default.seconds(RETRY_WAIT_SECONDS))];
|
||||||
case 1:
|
case 1:
|
||||||
_a.sent();
|
_a.sent();
|
||||||
core_1.debug("Waited " + (Date.now() - waitStart) + "ms");
|
(0, core_1.debug)("Waited ".concat(Date.now() - waitStart, "ms"));
|
||||||
core_1.debug("Configured wait: " + milliseconds_1.default.seconds(RETRY_WAIT_SECONDS) + "ms");
|
(0, core_1.debug)("Configured wait: ".concat(milliseconds_1.default.seconds(RETRY_WAIT_SECONDS), "ms"));
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -720,7 +720,7 @@ function getExecutable() {
|
|||||||
}
|
}
|
||||||
case "sh": {
|
case "sh": {
|
||||||
if (OS === 'win32') {
|
if (OS === 'win32') {
|
||||||
throw new Error("Shell " + SHELL + " not allowed on OS " + OS);
|
throw new Error("Shell ".concat(SHELL, " not allowed on OS ").concat(OS));
|
||||||
}
|
}
|
||||||
executable = SHELL;
|
executable = SHELL;
|
||||||
break;
|
break;
|
||||||
@@ -728,13 +728,13 @@ function getExecutable() {
|
|||||||
case "cmd":
|
case "cmd":
|
||||||
case "powershell": {
|
case "powershell": {
|
||||||
if (OS !== 'win32') {
|
if (OS !== 'win32') {
|
||||||
throw new Error("Shell " + SHELL + " not allowed on OS " + OS);
|
throw new Error("Shell ".concat(SHELL, " not allowed on OS ").concat(OS));
|
||||||
}
|
}
|
||||||
executable = SHELL + ".exe";
|
executable = SHELL + ".exe";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
throw new Error("Shell " + SHELL + " not supported. See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell for supported shells");
|
throw new Error("Shell ".concat(SHELL, " not supported. See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell for supported shells"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return executable;
|
return executable;
|
||||||
@@ -752,13 +752,13 @@ function runRetryCmd() {
|
|||||||
_a.label = 1;
|
_a.label = 1;
|
||||||
case 1:
|
case 1:
|
||||||
_a.trys.push([1, 3, , 4]);
|
_a.trys.push([1, 3, , 4]);
|
||||||
return [4 /*yield*/, child_process_1.execSync(ON_RETRY_COMMAND, { stdio: 'inherit' })];
|
return [4 /*yield*/, (0, child_process_1.execSync)(ON_RETRY_COMMAND, { stdio: 'inherit' })];
|
||||||
case 2:
|
case 2:
|
||||||
_a.sent();
|
_a.sent();
|
||||||
return [3 /*break*/, 4];
|
return [3 /*break*/, 4];
|
||||||
case 3:
|
case 3:
|
||||||
error_1 = _a.sent();
|
error_1 = _a.sent();
|
||||||
core_1.info("WARNING: Retry command threw the error " + error_1.message);
|
(0, core_1.info)("WARNING: Retry command threw the error ".concat(error_1.message));
|
||||||
return [3 /*break*/, 4];
|
return [3 /*break*/, 4];
|
||||||
case 4: return [2 /*return*/];
|
case 4: return [2 /*return*/];
|
||||||
}
|
}
|
||||||
@@ -776,10 +776,10 @@ function runCmd(attempt) {
|
|||||||
executable = getExecutable();
|
executable = getExecutable();
|
||||||
exit = 0;
|
exit = 0;
|
||||||
done = false;
|
done = false;
|
||||||
core_1.debug("Running command " + COMMAND + " on " + OS + " using shell " + executable);
|
(0, core_1.debug)("Running command ".concat(COMMAND, " on ").concat(OS, " using shell ").concat(executable));
|
||||||
child = attempt > 1 && NEW_COMMAND_ON_RETRY
|
child = attempt > 1 && NEW_COMMAND_ON_RETRY
|
||||||
? child_process_1.exec(NEW_COMMAND_ON_RETRY, { 'shell': executable })
|
? (0, child_process_1.exec)(NEW_COMMAND_ON_RETRY, { 'shell': executable })
|
||||||
: child_process_1.exec(COMMAND, { 'shell': executable });
|
: (0, child_process_1.exec)(COMMAND, { 'shell': executable });
|
||||||
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', function (data) {
|
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', function (data) {
|
||||||
process.stdout.write(data);
|
process.stdout.write(data);
|
||||||
});
|
});
|
||||||
@@ -787,8 +787,8 @@ function runCmd(attempt) {
|
|||||||
process.stdout.write(data);
|
process.stdout.write(data);
|
||||||
});
|
});
|
||||||
child.on('exit', function (code, signal) {
|
child.on('exit', function (code, signal) {
|
||||||
core_1.debug("Code: " + code);
|
(0, core_1.debug)("Code: ".concat(code));
|
||||||
core_1.debug("Signal: " + signal);
|
(0, core_1.debug)("Signal: ".concat(signal));
|
||||||
if (code && code > 0) {
|
if (code && code > 0) {
|
||||||
exit = code;
|
exit = code;
|
||||||
}
|
}
|
||||||
@@ -799,7 +799,7 @@ function runCmd(attempt) {
|
|||||||
done = true;
|
done = true;
|
||||||
});
|
});
|
||||||
_c.label = 1;
|
_c.label = 1;
|
||||||
case 1: return [4 /*yield*/, util_1.wait(milliseconds_1.default.seconds(POLLING_INTERVAL_SECONDS))];
|
case 1: return [4 /*yield*/, (0, util_1.wait)(milliseconds_1.default.seconds(POLLING_INTERVAL_SECONDS))];
|
||||||
case 2:
|
case 2:
|
||||||
_c.sent();
|
_c.sent();
|
||||||
_c.label = 3;
|
_c.label = 3;
|
||||||
@@ -807,18 +807,18 @@ function runCmd(attempt) {
|
|||||||
if (Date.now() < end_time && !done) return [3 /*break*/, 1];
|
if (Date.now() < end_time && !done) return [3 /*break*/, 1];
|
||||||
_c.label = 4;
|
_c.label = 4;
|
||||||
case 4:
|
case 4:
|
||||||
if (!!done) return [3 /*break*/, 6];
|
if (!(!done && child.pid)) return [3 /*break*/, 6];
|
||||||
tree_kill_1.default(child.pid);
|
(0, tree_kill_1.default)(child.pid);
|
||||||
return [4 /*yield*/, retryWait()];
|
return [4 /*yield*/, retryWait()];
|
||||||
case 5:
|
case 5:
|
||||||
_c.sent();
|
_c.sent();
|
||||||
throw new Error("Timeout of " + getTimeout() + "ms hit");
|
throw new Error("Timeout of ".concat(getTimeout(), "ms hit"));
|
||||||
case 6:
|
case 6:
|
||||||
if (!(exit > 0)) return [3 /*break*/, 8];
|
if (!(exit > 0)) return [3 /*break*/, 8];
|
||||||
return [4 /*yield*/, retryWait()];
|
return [4 /*yield*/, retryWait()];
|
||||||
case 7:
|
case 7:
|
||||||
_c.sent();
|
_c.sent();
|
||||||
throw new Error("Child_process exited with error code " + exit);
|
throw new Error("Child_process exited with error code ".concat(exit));
|
||||||
case 8: return [2 /*return*/];
|
case 8: return [2 /*return*/];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -840,16 +840,16 @@ function runAction() {
|
|||||||
case 3:
|
case 3:
|
||||||
_a.trys.push([3, 5, , 12]);
|
_a.trys.push([3, 5, , 12]);
|
||||||
// just keep overwriting attempts output
|
// just keep overwriting attempts output
|
||||||
core_1.setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
|
(0, core_1.setOutput)(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
|
||||||
return [4 /*yield*/, runCmd(attempt)];
|
return [4 /*yield*/, runCmd(attempt)];
|
||||||
case 4:
|
case 4:
|
||||||
_a.sent();
|
_a.sent();
|
||||||
core_1.info("Command completed after " + attempt + " attempt(s).");
|
(0, core_1.info)("Command completed after ".concat(attempt, " attempt(s)."));
|
||||||
return [3 /*break*/, 13];
|
return [3 /*break*/, 13];
|
||||||
case 5:
|
case 5:
|
||||||
error_2 = _a.sent();
|
error_2 = _a.sent();
|
||||||
if (!(attempt === MAX_ATTEMPTS)) return [3 /*break*/, 6];
|
if (!(attempt === MAX_ATTEMPTS)) return [3 /*break*/, 6];
|
||||||
throw new Error("Final attempt failed. " + error_2.message);
|
throw new Error("Final attempt failed. ".concat(error_2.message));
|
||||||
case 6:
|
case 6:
|
||||||
if (!(!done && RETRY_ON === 'error')) return [3 /*break*/, 7];
|
if (!(!done && RETRY_ON === 'error')) return [3 /*break*/, 7];
|
||||||
// error: timeout
|
// error: timeout
|
||||||
@@ -865,10 +865,10 @@ function runAction() {
|
|||||||
case 10:
|
case 10:
|
||||||
_a.sent();
|
_a.sent();
|
||||||
if (WARNING_ON_RETRY) {
|
if (WARNING_ON_RETRY) {
|
||||||
core_1.warning("Attempt " + attempt + " failed. Reason: " + error_2.message);
|
(0, core_1.warning)("Attempt ".concat(attempt, " failed. Reason: ").concat(error_2.message));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core_1.info("Attempt " + attempt + " failed. Reason: " + error_2.message);
|
(0, core_1.info)("Attempt ".concat(attempt, " failed. Reason: ").concat(error_2.message));
|
||||||
}
|
}
|
||||||
_a.label = 11;
|
_a.label = 11;
|
||||||
case 11: return [3 /*break*/, 12];
|
case 11: return [3 /*break*/, 12];
|
||||||
@@ -882,21 +882,21 @@ function runAction() {
|
|||||||
}
|
}
|
||||||
runAction()
|
runAction()
|
||||||
.then(function () {
|
.then(function () {
|
||||||
core_1.setOutput(OUTPUT_EXIT_CODE_KEY, 0);
|
(0, core_1.setOutput)(OUTPUT_EXIT_CODE_KEY, 0);
|
||||||
process.exit(0); // success
|
process.exit(0); // success
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
// exact error code if available, otherwise just 1
|
// exact error code if available, otherwise just 1
|
||||||
var exitCode = exit > 0 ? exit : 1;
|
var exitCode = exit > 0 ? exit : 1;
|
||||||
if (CONTINUE_ON_ERROR) {
|
if (CONTINUE_ON_ERROR) {
|
||||||
core_1.warning(err.message);
|
(0, core_1.warning)(err.message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core_1.error(err.message);
|
(0, core_1.error)(err.message);
|
||||||
}
|
}
|
||||||
// these can be helpful to know if continue-on-error is true
|
// these can be helpful to know if continue-on-error is true
|
||||||
core_1.setOutput(OUTPUT_EXIT_ERROR_KEY, err.message);
|
(0, core_1.setOutput)(OUTPUT_EXIT_ERROR_KEY, err.message);
|
||||||
core_1.setOutput(OUTPUT_EXIT_CODE_KEY, exitCode);
|
(0, core_1.setOutput)(OUTPUT_EXIT_CODE_KEY, exitCode);
|
||||||
// if continue_on_error, exit with exact error code else exit gracefully
|
// if continue_on_error, exit with exact error code else exit gracefully
|
||||||
// mimics native continue-on-error that is not supported in composite actions
|
// mimics native continue-on-error that is not supported in composite actions
|
||||||
process.exit(CONTINUE_ON_ERROR ? 0 : exitCode);
|
process.exit(CONTINUE_ON_ERROR ? 0 : exitCode);
|
||||||
|
|||||||
47
package-lock.json
generated
47
package-lock.json
generated
@@ -19,13 +19,13 @@
|
|||||||
"@semantic-release/changelog": "^6.0.1",
|
"@semantic-release/changelog": "^6.0.1",
|
||||||
"@semantic-release/git": "^10.0.1",
|
"@semantic-release/git": "^10.0.1",
|
||||||
"@types/milliseconds": "0.0.30",
|
"@types/milliseconds": "0.0.30",
|
||||||
"@types/node": "14.14.7",
|
"@types/node": "^16.11.7",
|
||||||
"@zeit/ncc": "^0.20.5",
|
"@zeit/ncc": "^0.20.5",
|
||||||
"dotenv": "8.2.0",
|
"dotenv": "8.2.0",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"semantic-release": "19.0.3",
|
"semantic-release": "19.0.3",
|
||||||
"ts-node": "9.0.0",
|
"ts-node": "9.0.0",
|
||||||
"typescript": "4.0.5"
|
"typescript": "^4.7.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
@@ -362,19 +362,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@commitlint/load/node_modules/typescript": {
|
|
||||||
"version": "4.6.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz",
|
|
||||||
"integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"tsc": "bin/tsc",
|
|
||||||
"tsserver": "bin/tsserver"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@commitlint/message": {
|
"node_modules/@commitlint/message": {
|
||||||
"version": "16.2.1",
|
"version": "16.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@commitlint/message/-/message-16.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@commitlint/message/-/message-16.2.1.tgz",
|
||||||
@@ -1256,9 +1243,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "14.14.7",
|
"version": "16.11.47",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.47.tgz",
|
||||||
"integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==",
|
"integrity": "sha512-fpP+jk2zJ4VW66+wAMFoBJlx1bxmBKx4DUFf68UHgdGCOuyUTDlLWqsaNPJh7xhNDykyJ9eIzAygilP/4WoN8g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/normalize-package-data": {
|
"node_modules/@types/normalize-package-data": {
|
||||||
@@ -7108,9 +7095,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.0.5",
|
"version": "4.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
|
||||||
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==",
|
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
@@ -7644,12 +7631,6 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"has-flag": "^4.0.0"
|
"has-flag": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"typescript": {
|
|
||||||
"version": "4.6.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz",
|
|
||||||
"integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==",
|
|
||||||
"dev": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -8334,9 +8315,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "14.14.7",
|
"version": "16.11.47",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.47.tgz",
|
||||||
"integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==",
|
"integrity": "sha512-fpP+jk2zJ4VW66+wAMFoBJlx1bxmBKx4DUFf68UHgdGCOuyUTDlLWqsaNPJh7xhNDykyJ9eIzAygilP/4WoN8g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/normalize-package-data": {
|
"@types/normalize-package-data": {
|
||||||
@@ -12607,9 +12588,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.0.5",
|
"version": "4.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
|
||||||
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==",
|
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"uglify-js": {
|
"uglify-js": {
|
||||||
|
|||||||
@@ -28,13 +28,13 @@
|
|||||||
"@semantic-release/changelog": "^6.0.1",
|
"@semantic-release/changelog": "^6.0.1",
|
||||||
"@semantic-release/git": "^10.0.1",
|
"@semantic-release/git": "^10.0.1",
|
||||||
"@types/milliseconds": "0.0.30",
|
"@types/milliseconds": "0.0.30",
|
||||||
"@types/node": "14.14.7",
|
"@types/node": "^16.11.7",
|
||||||
"@zeit/ncc": "^0.20.5",
|
"@zeit/ncc": "^0.20.5",
|
||||||
"dotenv": "8.2.0",
|
"dotenv": "8.2.0",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"semantic-release": "19.0.3",
|
"semantic-release": "19.0.3",
|
||||||
"ts-node": "9.0.0",
|
"ts-node": "9.0.0",
|
||||||
"typescript": "4.0.5"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ async function runRetryCmd(): Promise<void> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await execSync(ON_RETRY_COMMAND, { stdio: 'inherit' });
|
await execSync(ON_RETRY_COMMAND, { stdio: 'inherit' });
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
info(`WARNING: Retry command threw the error ${error.message}`)
|
info(`WARNING: Retry command threw the error ${error.message}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ async function runCmd(attempt: number) {
|
|||||||
await wait(ms.seconds(POLLING_INTERVAL_SECONDS));
|
await wait(ms.seconds(POLLING_INTERVAL_SECONDS));
|
||||||
} while (Date.now() < end_time && !done);
|
} while (Date.now() < end_time && !done);
|
||||||
|
|
||||||
if (!done) {
|
if (!done && child.pid) {
|
||||||
kill(child.pid);
|
kill(child.pid);
|
||||||
await retryWait();
|
await retryWait();
|
||||||
throw new Error(`Timeout of ${getTimeout()}ms hit`);
|
throw new Error(`Timeout of ${getTimeout()}ms hit`);
|
||||||
@@ -182,7 +182,7 @@ async function runAction() {
|
|||||||
await runCmd(attempt);
|
await runCmd(attempt);
|
||||||
info(`Command completed after ${attempt} attempt(s).`);
|
info(`Command completed after ${attempt} attempt(s).`);
|
||||||
break;
|
break;
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
if (attempt === MAX_ATTEMPTS) {
|
if (attempt === MAX_ATTEMPTS) {
|
||||||
throw new Error(`Final attempt failed. ${error.message}`);
|
throw new Error(`Final attempt failed. ${error.message}`);
|
||||||
} else if (!done && RETRY_ON === 'error') {
|
} else if (!done && RETRY_ON === 'error') {
|
||||||
|
|||||||
Reference in New Issue
Block a user