X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FSharedLRUCache.ts;h=6b6df2049117f96a6c3df3881a73a1f4c5ae28fa;hb=07c52a72c0b8ab72dc37241892e02b229e70c0f6;hp=e235c51d1f930a764c1e2ef8198b792711254b31;hpb=1895299db899eb53db7fb1615b82624f806017e8;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/SharedLRUCache.ts b/src/charging-station/SharedLRUCache.ts index e235c51d..6b6df204 100644 --- a/src/charging-station/SharedLRUCache.ts +++ b/src/charging-station/SharedLRUCache.ts @@ -1,5 +1,6 @@ import LRUCache from 'mnemonist/lru-map-with-delete'; +import { Bootstrap } from '../internal'; import type { ChargingStationConfiguration } from '../types/ChargingStationConfiguration'; import type { ChargingStationTemplate } from '../types/ChargingStationTemplate'; import Utils from '../utils/Utils'; @@ -16,7 +17,10 @@ export default class SharedLRUCache { private readonly lruCache: LRUCache; private constructor() { - this.lruCache = new LRUCache(1000); + this.lruCache = new LRUCache( + Bootstrap.getInstance().numberOfChargingStationTemplates + + Bootstrap.getInstance().numberOfChargingStations + ); } public static getInstance(): SharedLRUCache {