repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: avoid worker-threads restart at error during startup
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
OCPPRequestService.ts
diff --git
a/src/charging-station/ocpp/OCPPRequestService.ts
b/src/charging-station/ocpp/OCPPRequestService.ts
index 4e094a21bcf58db12067cff530563ac6ec05d12f..ccab6468353d32e58eaf5a2317d63848ca18aee0 100644
(file)
--- a/
src/charging-station/ocpp/OCPPRequestService.ts
+++ b/
src/charging-station/ocpp/OCPPRequestService.ts
@@
-173,7
+173,7
@@
export abstract class OCPPRequestService {
messageId: string,
messagePayload: JsonType,
commandName: RequestCommand,
messageId: string,
messagePayload: JsonType,
commandName: RequestCommand,
- params
: RequestParams = default
RequestParams,
+ params
?:
RequestParams,
): Promise<ResponseType> {
params = {
...defaultRequestParams,
): Promise<ResponseType> {
params = {
...defaultRequestParams,
@@
-276,7
+276,7
@@
export abstract class OCPPRequestService {
messagePayload: JsonType | OCPPError,
messageType: MessageType,
commandName: RequestCommand | IncomingRequestCommand,
messagePayload: JsonType | OCPPError,
messageType: MessageType,
commandName: RequestCommand | IncomingRequestCommand,
- params
: RequestParams = default
RequestParams,
+ params
?:
RequestParams,
): Promise<ResponseType> {
params = {
...defaultRequestParams,
): Promise<ResponseType> {
params = {
...defaultRequestParams,
@@
-295,7
+295,7
@@
export abstract class OCPPRequestService {
const self = this;
// Send a message through wsConnection
return promiseWithTimeout(
const self = this;
// Send a message through wsConnection
return promiseWithTimeout(
- new Promise((resolve, reject) => {
+ new Promise
<ResponseType>
((resolve, reject) => {
/**
* Function that will receive the request's response
*
/**
* Function that will receive the request's response
*
@@
-388,7
+388,7
@@
export abstract class OCPPRequestService {
PerformanceStatistics.endMeasure(commandName, beginId);
}
const wsClosedOrErrored = !wsOpened || sendError === true;
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
// Buffer
chargingStation.bufferMessage(messageToSend);
// Reject and keep request in the cache