Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Nov 3, 2024
1 parent e11ce0a commit 7785254
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ export const main = async (argv: any, version?: string) => {
"request-count": record.req,
"success-count": record.success,
"failure-count": record.failure,
"timeout-count": Object.keys(record.cache).length,
"timeout-count": record.req - record.success - record.failure,
});
record.req = 0;
record.success = 0;
Expand Down
9 changes: 0 additions & 9 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
RpcRecord,
ViemClient,
ChainConfig,
isRpcRequest,
isRpcResponse,
BotDataFetcher,
} from "./types";
Expand Down Expand Up @@ -132,13 +131,6 @@ export function onFetchRequest(request: Request, rpcRecords: Record<string, RpcR
cache: {},
};
record.req++;
request
.json()
.then((v) => {
if (isRpcRequest(v)) record.cache[v.id] = {};
else record.req--;
})
.catch(() => {});
}

/**
Expand All @@ -163,7 +155,6 @@ export function onFetchResponse(response: Response, rpcRecords: Record<string, R
.json()
.then((v) => {
if (isRpcResponse(v)) {
delete record.cache[v.id];
if (response.status === 200) {
if ("result" in v) record.success++;
else record.failure++;
Expand Down

0 comments on commit 7785254

Please sign in to comment.