refactor: unflag worker startup at the right time on worker set
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPRequestService.ts
index 4e456963798a6f121b1bd89594dd956f59c49bce..ccab6468353d32e58eaf5a2317d63848ca18aee0 100644 (file)
@@ -173,7 +173,7 @@ export abstract class OCPPRequestService {
     messageId: string,
     messagePayload: JsonType,
     commandName: RequestCommand,
-    params: RequestParams = defaultRequestParams,
+    params?: RequestParams,
   ): Promise<ResponseType> {
     params = {
       ...defaultRequestParams,
@@ -276,7 +276,7 @@ export abstract class OCPPRequestService {
     messagePayload: JsonType | OCPPError,
     messageType: MessageType,
     commandName: RequestCommand | IncomingRequestCommand,
-    params: RequestParams = defaultRequestParams,
+    params?: RequestParams,
   ): Promise<ResponseType> {
     params = {
       ...defaultRequestParams,
@@ -388,7 +388,7 @@ export abstract class OCPPRequestService {
             PerformanceStatistics.endMeasure(commandName, beginId);
           }
           const wsClosedOrErrored = !wsOpened || sendError === true;
-          if (wsClosedOrErrored && params.skipBufferingOnError === false) {
+          if (wsClosedOrErrored && params?.skipBufferingOnError === false) {
             // Buffer
             chargingStation.bufferMessage(messageToSend);
             // Reject and keep request in the cache