From f5099a454688883b503a73a62fa3d63d27889c7c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 29 Mar 2023 12:10:56 -0400 Subject: [PATCH] *Disable RPC caching for now --- src/client/rpc/rpc.ts | 2 +- src/index.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/rpc/rpc.ts b/src/client/rpc/rpc.ts index fbec543..73b7753 100644 --- a/src/client/rpc/rpc.ts +++ b/src/client/rpc/rpc.ts @@ -81,7 +81,7 @@ export class RPC { const hash = this._pluginApi.util.crypto .createHash(stringify(tempRequest)) .toString("hex"); - this._cache.set(hash, response); + // this._cache.set(hash, response); } return { success: !response.error, diff --git a/src/index.ts b/src/index.ts index 89e21fa..e14efb4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -133,7 +133,7 @@ const plugin: Plugin = { api.registerMethod("execution_request", { cacheable: false, async handler(request: ExecutionRequest): Promise { - const cache = provider.rpc.getCachedRequest(request); + /* const cache = provider.rpc.getCachedRequest(request); if (cache) { return cache; @@ -148,7 +148,9 @@ const plugin: Plugin = { if (RPC_NO_CACHE.includes(request.method)) { provider.rpc.deleteCachedRequest(request); - } + }*/ + + let ret = await provider.rpc.request(request); // @ts-ignore return { ...ret, id: request.id ?? ret.id }; },