-import { parentPort } from 'worker_threads';
-
import type { JSONSchemaType } from 'ajv';
import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
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';
reject(error);
} finally {
chargingStation.requests.delete(messageId);
- // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation));
}
}
* @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
error
);
chargingStation.requests.delete(messageId);
- // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation));
reject(error);
}
}),
error: Error,
params: HandleErrorParams<EmptyObject> = { 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;
}