From: Jérôme Benoit Date: Tue, 25 Jul 2023 22:02:04 +0000 (+0200) Subject: docs: refine code comments X-Git-Tag: v1.2.20~137 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d467756c6bffa394dc17e9a54b97a3679e9a512a;p=e-mobility-charging-stations-simulator.git docs: refine code comments Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index 0eeb2051..23b42d5c 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -672,8 +672,10 @@ interface ChargingProfilesLimit { } /** - * Charging profiles should already be sorted by connector id and stack level (highest stack level has priority) + * Charging profiles shall already be sorted by connector id and stack level (highest stack level has priority) * + * @param chargingStation - + * @param connectorId - * @param chargingProfiles - * @param logPrefix - * @returns ChargingProfilesLimit diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 54b07510..48d0587c 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -262,11 +262,12 @@ export const insertAt = (str: string, subStr: string, pos: number): string => * Computes the retry delay in milliseconds using an exponential backoff algorithm. * * @param retryNumber - the number of retries that have already been attempted + * @param maxDelayRatio - the maximum ratio of the delay that can be randomized * @returns delay in milliseconds */ export const exponentialDelay = (retryNumber = 0, maxDelayRatio = 0.2): number => { const delay = Math.pow(2, retryNumber) * 100; - const randomSum = delay * maxDelayRatio * secureRandom(); // 0-20% of the delay + const randomSum = delay * maxDelayRatio * secureRandom(); // 0-(maxDelayRatio*100)% of the delay return delay + randomSum; };