From ff9fca275288d7c9c7b9848b5935fe4f68db24c0 Mon Sep 17 00:00:00 2001 From: Shaya Potter Date: Tue, 5 Nov 2024 12:05:58 +0200 Subject: [PATCH] nits to try and fix github --- packages/client/lib/client/cache.spec.ts | 2 +- packages/client/lib/client/cache.ts | 16 ++++++++-------- packages/client/lib/sentinel/index.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/client/lib/client/cache.spec.ts b/packages/client/lib/client/cache.spec.ts index ee08d3a69f..258104ed4c 100644 --- a/packages/client/lib/client/cache.spec.ts +++ b/packages/client/lib/client/cache.spec.ts @@ -227,7 +227,7 @@ describe("Client Side Cache", () => { }); }); - describe.only("Pooled Cache", () => { + describe("Pooled Cache", () => { const csc = new BasicPooledClientSideCache(); testUtils.testWithClient('Virtual Pool Disconnect', async client1 => { diff --git a/packages/client/lib/client/cache.ts b/packages/client/lib/client/cache.ts index 03eee829b6..73e08587b1 100644 --- a/packages/client/lib/client/cache.ts +++ b/packages/client/lib/client/cache.ts @@ -54,7 +54,7 @@ abstract class ClientSideCacheEntryBase implements ClientSideCacheEntry { } } -export class ClientSideCacheEntryValue extends ClientSideCacheEntryBase { +class ClientSideCacheEntryValue extends ClientSideCacheEntryBase { readonly #value: any; get value() { @@ -67,7 +67,7 @@ export class ClientSideCacheEntryValue extends ClientSideCacheEntryBase { } } -export class ClientSideCacheEntryPromise extends ClientSideCacheEntryBase { +class ClientSideCacheEntryPromise extends ClientSideCacheEntryBase { readonly #sendCommandPromise: Promise; get promise() { @@ -95,8 +95,8 @@ export class BasicClientSideCache extends ClientSideCacheProvider { #cacheKeyToEntryMap: Map; #keyToCacheKeySetMap: Map>; readonly ttl: number; - readonly #maxEntries: number; - readonly #lru: boolean; + readonly maxEntries: number; + readonly lru: boolean; #cacheHits = 0; #cacheMisses = 0; @@ -106,8 +106,8 @@ export class BasicClientSideCache extends ClientSideCacheProvider { this.#cacheKeyToEntryMap = new Map(); this.#keyToCacheKeySetMap = new Map>(); this.ttl = config?.ttl ?? 0; - this.#maxEntries = config?.maxEntries ?? 0; - this.#lru = config?.lru ?? true; + this.maxEntries = config?.maxEntries ?? 0; + this.lru = config?.lru ?? true; } /* logic of how caching works: @@ -240,7 +240,7 @@ export class BasicClientSideCache extends ClientSideCacheProvider { return undefined; } - if (val !== undefined && this.#lru) { + if (val !== undefined && this.lru) { this.#cacheKeyToEntryMap.delete(cacheKey); this.#cacheKeyToEntryMap.set(cacheKey, val); } @@ -268,7 +268,7 @@ export class BasicClientSideCache extends ClientSideCacheProvider { oldEntry.invalidate(); } - if (this.#maxEntries > 0 && count >= this.#maxEntries) { + if (this.maxEntries > 0 && count >= this.maxEntries) { this.deleteOldest(); } diff --git a/packages/client/lib/sentinel/index.ts b/packages/client/lib/sentinel/index.ts index 519c2828b5..9d9674478f 100644 --- a/packages/client/lib/sentinel/index.ts +++ b/packages/client/lib/sentinel/index.ts @@ -612,7 +612,7 @@ class RedisSentinelInternal< this.#scanInterval = options.scanInterval ?? 0; this.#passthroughClientErrorEvents = options.passthroughClientErrorEvents ?? false; - this.#nodeClientOptions = options.nodeClientOptions ? {...options.nodeClientOptions} : {}; + this.#nodeClientOptions = (options.nodeClientOptions ? {...options.nodeClientOptions} : {}) as RedisClientOptions; if (this.#nodeClientOptions.url !== undefined) { throw new Error("invalid nodeClientOptions for Sentinel"); }