Skip to content

Commit

Permalink
add refreshMainnetProviderEstimatedRewards to indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecot committed Jan 24, 2025
1 parent afbec49 commit 8c93dbb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/redis/classes/IndexerRedisResourceCaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { AllProviderAPRResource } from '../resources/ajax/AllProviderAprResource
import { LockedTokenValuesResource } from '../resources/ajax/LockedTokenValuesResource';
import { LockedVestingTokensService } from '../resources/global/LockedVestingTokensResource';
import { IpRpcEndpointsIndexService } from '../resources/IpRpcEndpointsIndex/IpRpcEndpointsResource';
import { MainnetProviderEstimatedRewardsListService } from '../resources/MainnetProviderEstimatedRewards/MainnetProviderEstimatedRewardsListResource';

export class IndexerRedisResourceCaller {
private static readonly REFRESH_INTERVAL = 60 * 1000; // 1 minute
Expand Down Expand Up @@ -99,7 +100,8 @@ export class IndexerRedisResourceCaller {
this.refreshAjaxResources(),
this.refreshIndexResources(),
this.refreshGlobalResources(),
this.refreshIpRpcEndpoints()
this.refreshIpRpcEndpoints(),
this.refreshMainnetProviderEstimatedRewards()
]);

const duration = Date.now() - startTime;
Expand Down Expand Up @@ -266,5 +268,12 @@ export class IndexerRedisResourceCaller {
this.currentFetches
).catch(e => logger.error('Failed to refresh ip rpc endpoints:', e));
}

private static async refreshMainnetProviderEstimatedRewards(): Promise<void> {
await this.safeFetch('MainnetProviderEstimatedRewards',
() => MainnetProviderEstimatedRewardsListService.fetch(),
this.currentFetches
).catch(e => logger.error('Failed to refresh mainnet provider estimated rewards:', e));
}
}

0 comments on commit 8c93dbb

Please sign in to comment.