From b37b3052ec9e28dc6d9f715773b38d541aac875f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 18 Aug 2022 19:29:06 -0400 Subject: [PATCH] *Update force to bypassCache --- src/rpc.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rpc.ts b/src/rpc.ts index f9ed90f..e0b2d36 100644 --- a/src/rpc.ts +++ b/src/rpc.ts @@ -41,7 +41,7 @@ let _aat: PocketAATObject; let jsonServer: jayson.Server; interface RPCRequest { - force: boolean; + bypassCache: boolean; chain: string; query: string; data: string; @@ -64,7 +64,7 @@ function getRequestId(request: RPCRequest) { const clonedRequest = Object.assign({}, request); // @ts-ignore - delete clonedRequest.force; + delete clonedRequest.bypassCache; return hash(stringify(clonedRequest)); } @@ -98,7 +98,7 @@ async function processRequest(request: RPCRequest): Promise { } await lock.acquire(); - if (!request.force && processedRequests.get(reqId)) { + if (!request.bypassCache && processedRequests.get(reqId)) { return processedRequests.get(reqId) as RPCResponse; } @@ -142,7 +142,7 @@ async function processRequest(request: RPCRequest): Promise { : (rpcResp as unknown as JSONRPCResponseWithResult).result; if ( - (!processedRequests.get(reqId) || request.force) && + (!processedRequests.get(reqId) || request.bypassCache) && dbData.data?.error !== ERR_NOT_READY ) { processedRequests.set(reqId, dbData);