Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/sites/node_modules/@aws-sdk/util-waiter/dist-es/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import { __awaiter, __generator } from "tslib";
import { sleep } from "./utils/sleep";
import { WaiterState } from "./waiter";
var exponentialBackoffWithJitter = function (minDelay, maxDelay, attemptCeiling, attempt) {
if (attempt > attemptCeiling)
return maxDelay;
var delay = minDelay * Math.pow(2, (attempt - 1));
return randomInRange(minDelay, delay);
};
var randomInRange = function (min, max) { return min + Math.random() * (max - min); };
export var runPolling = function (_a, input, acceptorChecks) {
var minDelay = _a.minDelay, maxDelay = _a.maxDelay, maxWaitTime = _a.maxWaitTime, abortController = _a.abortController, client = _a.client, abortSignal = _a.abortSignal;
return __awaiter(void 0, void 0, void 0, function () {
var state, currentAttempt, waitUntil, attemptCeiling, delay, state_1;
var _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4, acceptorChecks(client, input)];
case 1:
state = (_c.sent()).state;
if (state !== WaiterState.RETRY) {
return [2, { state: state }];
}
currentAttempt = 1;
waitUntil = Date.now() + maxWaitTime * 1000;
attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1;
_c.label = 2;
case 2:
if (!true) return [3, 5];
if (((_b = abortController === null || abortController === void 0 ? void 0 : abortController.signal) === null || _b === void 0 ? void 0 : _b.aborted) || (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) {
return [2, { state: WaiterState.ABORTED }];
}
delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt);
if (Date.now() + delay * 1000 > waitUntil) {
return [2, { state: WaiterState.TIMEOUT }];
}
return [4, sleep(delay)];
case 3:
_c.sent();
return [4, acceptorChecks(client, input)];
case 4:
state_1 = (_c.sent()).state;
if (state_1 !== WaiterState.RETRY) {
return [2, { state: state_1 }];
}
currentAttempt += 1;
return [3, 2];
case 5: return [2];
}
});
});
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0062 ]-- |