private getRandomIdTag(hashId: string, file: string): string {
const idTags = this.getIdTags(file);
- const addressableKey = this.getIdTagsCacheAddressableKey(file, hashId);
+ const addressableKey = this.getIdTagsCacheIndexesAddressableKey(file, hashId);
this.idTagsCachesAddressableIndexes.set(
addressableKey,
Math.floor(Utils.secureRandom() * idTags.length)
private getRoundRobinIdTag(hashId: string, file: string): string {
const idTags = this.getIdTags(file);
- const addressableKey = this.getIdTagsCacheAddressableKey(file, hashId);
+ const addressableKey = this.getIdTagsCacheIndexesAddressableKey(file, hashId);
const idTagIndex = this.idTagsCachesAddressableIndexes.get(addressableKey) ?? 0;
const idTag = idTags[idTagIndex];
this.idTagsCachesAddressableIndexes.set(
const file = ChargingStationUtils.getIdTagsFile(chargingStation.stationInfo);
const idTags = this.getIdTags(file);
const hashId = chargingStation.stationInfo.hashId;
- const addressableKey = this.getIdTagsCacheAddressableKey(file, hashId);
+ const addressableKey = this.getIdTagsCacheIndexesAddressableKey(file, hashId);
this.idTagsCachesAddressableIndexes.set(
addressableKey,
(chargingStation.index - 1 + (connectorId - 1)) % idTags.length
}
}
- private getIdTagsCacheAddressableKey(prefix: string, uid: string): string {
+ private getIdTagsCacheIndexesAddressableKey(prefix: string, uid: string): string {
return `${prefix}${uid}`;
}