From 86ce21a4b4bd7eb434b5c2e0a0eea04daf1754dc Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 26 Nov 2022 18:23:26 -0500 Subject: [PATCH] *If we have a cached request, release the lock --- src/modules/rpc/server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/rpc/server.ts b/src/modules/rpc/server.ts index 08ff6c7..b1b1477 100644 --- a/src/modules/rpc/server.ts +++ b/src/modules/rpc/server.ts @@ -147,6 +147,7 @@ export class RPCServer extends EventEmitter { let cachedRequest = this.getCachedRequest(request) as RPCCacheItem; if (cachedRequest) { + this.getRequestLock(request)?.release(); return cachedRequest.value; } @@ -193,7 +194,7 @@ export class RPCServer extends EventEmitter { private getCachedRequest(request: RPCRequest): RPCCacheItem | boolean { const req = RPCServer.hashQuery(request); if (RPCServer.hashQuery(request) in this._cache.data) { - this._cache.data[req]; + return this._cache.data[req] as RPCCacheItem; } return false;