- if (retrieveDate.getTime() <= Date.now()) {
- this.asyncResource
- .runInAsyncScope(
- this.updateFirmware.bind(this) as (
- this: OCPP16IncomingRequestService,
- ...args: any[]
- ) => Promise<void>,
- this,
- chargingStation
- )
- .catch(() => {
- /* This is intentional */
- });
+ const now = Date.now();
+ if (retrieveDate?.getTime() <= now) {
+ this.runInAsyncScope(
+ this.updateFirmware.bind(this) as (
+ this: OCPP16IncomingRequestService,
+ ...args: any[]
+ ) => Promise<void>,
+ this,
+ chargingStation
+ ).catch(() => {
+ /* This is intentional */
+ });