perf: unnecessary call to arweave.networkInfo when block height is request from client #70
This commit is contained in:
committed by
Piotr Pędziwiatr
parent
15f9bff17f
commit
a91f379e85
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
Benchmark,
|
||||
BlockHeightKey,
|
||||
BlockHeightSwCache,
|
||||
EvaluationOptions,
|
||||
@@ -26,6 +27,7 @@ export class CacheableContractInteractionsLoader implements InteractionsLoader {
|
||||
toBlockHeight: number,
|
||||
evaluationOptions?: EvaluationOptions
|
||||
): Promise<GQLEdgeInterface[]> {
|
||||
const benchmark = Benchmark.measure();
|
||||
this.logger.debug('Loading interactions', {
|
||||
contractId,
|
||||
fromBlockHeight,
|
||||
@@ -73,6 +75,8 @@ export class CacheableContractInteractionsLoader implements InteractionsLoader {
|
||||
// - that's why "result" variable is not used here
|
||||
await this.cache.put(new BlockHeightKey(contractId, toBlockHeight), valueToCache);
|
||||
|
||||
this.logger.debug(`Interactions loaded in ${benchmark.elapsed()}`);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user