generateUUID,
handleUncaughtException,
handleUnhandledRejection,
+ isAsyncFunction,
isNotEmptyArray,
logPrefix,
logger
}
private readonly workerEventPerformanceStatistics = (data: Statistics): void => {
- this.storage?.storePerformanceStatistics(data) as undefined
+ // eslint-disable-next-line @typescript-eslint/unbound-method
+ if (isAsyncFunction(this.storage?.storePerformanceStatistics)) {
+ (
+ this.storage.storePerformanceStatistics as (
+ performanceStatistics: Statistics
+ ) => Promise<void>
+ )(data).catch(Constants.EMPTY_FUNCTION)
+ } else {
+ (this.storage?.storePerformanceStatistics as (performanceStatistics: Statistics) => void)(
+ data
+ )
+ }
}
private initializeCounters (): void {