From: Jérôme Benoit Date: Sun, 11 Sep 2022 15:06:59 +0000 (+0200) Subject: Ensure requests are purged from the cache in case of responses processing X-Git-Tag: v1.1.73~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1ec17ecde818c7964816966f8defe2ec0a7c76c5;p=e-mobility-charging-stations-simulator.git Ensure requests are purged from the cache in case of responses processing error Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 1704821c..53f9076f 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1568,6 +1568,11 @@ export default class ChargingStation { error as OCPPError, commandName ?? requestCommandName ?? null ); + } else if ( + [MessageType.CALL_RESULT_MESSAGE, MessageType.CALL_ERROR_MESSAGE].includes(messageType) + ) { + // Remove the request from the cache + this.requests.delete(messageId); } } }