From: Jérôme Benoit Date: Sat, 4 Jun 2022 19:57:54 +0000 (+0200) Subject: Remove any usage in the charging station cache X-Git-Tag: v1.1.61~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0e89dd9a3274a9c5b1f0faf651525c43801e6249;p=e-mobility-charging-stations-simulator.git Remove any usage in the charging station cache Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStationCache.ts b/src/charging-station/ChargingStationCache.ts index 682e2d9c..b4e9b9d0 100644 --- a/src/charging-station/ChargingStationCache.ts +++ b/src/charging-station/ChargingStationCache.ts @@ -8,12 +8,14 @@ enum CacheType { CHARGING_STATION_CONFIGURATION = 'chargingStationConfiguration', } +type CacheableType = ChargingStationTemplate | ChargingStationConfiguration; + export class ChargingStationCache { private static instance: ChargingStationCache | null = null; - private readonly lruCache: LRUCache; + private readonly lruCache: LRUCache; private constructor() { - this.lruCache = new LRUCache(1000); + this.lruCache = new LRUCache(1000); } public static getInstance(): ChargingStationCache { @@ -79,11 +81,11 @@ export class ChargingStationCache { return this.lruCache.has(key); } - private get(key: string): any { + private get(key: string): CacheableType { return this.lruCache.get(key); } - private set(key: string, value: any): void { + private set(key: string, value: CacheableType): void { this.lruCache.set(key, value); }