X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPRequestService.ts;h=e78ca0c6dfa4d8fcec3049d05b67a11d62df82de;hb=7acb3f7bb991a6d02a4521c0cbc5f163aa5e8a61;hp=e00e2b99f9a2bbbddbdca10a6ae1427ffe982d2c;hpb=5e3cb7281de2b6fa8b61a453f964c2f213fefa80;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index e00e2b99..e78ca0c6 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -1,5 +1,3 @@ -import { parentPort } from 'worker_threads'; - import type { JSONSchemaType } from 'ajv'; import Ajv from 'ajv-draft-04'; import ajvFormats from 'ajv-formats'; @@ -23,7 +21,6 @@ import Constants from '../../utils/Constants'; import logger from '../../utils/Logger'; import Utils from '../../utils/Utils'; import type ChargingStation from '../ChargingStation'; -import { MessageChannelUtils } from '../MessageChannelUtils'; import type OCPPResponseService from './OCPPResponseService'; import { OCPPServiceUtils } from './OCPPServiceUtils'; @@ -254,7 +251,6 @@ export default abstract class OCPPRequestService { reject(error); } finally { chargingStation.requests.delete(messageId); - // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation)); } } @@ -265,7 +261,7 @@ export default abstract class OCPPRequestService { * @param requestStatistic */ function errorCallback(error: OCPPError, requestStatistic = true): void { - if (requestStatistic && chargingStation.getEnableStatistics()) { + if (requestStatistic === true && chargingStation.getEnableStatistics() === true) { chargingStation.performanceStatistics.addRequestStatistic( commandName, MessageType.CALL_ERROR_MESSAGE @@ -278,7 +274,6 @@ export default abstract class OCPPRequestService { error ); chargingStation.requests.delete(messageId); - // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation)); reject(error); } }), @@ -366,7 +361,7 @@ export default abstract class OCPPRequestService { error: Error, params: HandleErrorParams = { throwError: true } ): void { - logger.error(`${chargingStation.logPrefix()} Request command ${commandName} error:`, error); + logger.error(`${chargingStation.logPrefix()} Request command '${commandName}' error:`, error); if (params?.throwError) { throw error; }