Timing fixes to avoid burnout in the rpc layer

This commit is contained in:
Dummy Tester 123 2021-03-25 07:36:26 -05:00
parent eb13626ca7
commit 7a7e74b124
2 changed files with 10 additions and 5 deletions

View File

@ -104,7 +104,7 @@ function PlayStatusButton({
if (ineligibleToSee) {
const id = setInterval(() => {
connection.getSlot().then(setCurrSlot);
}, 400);
}, 5000);
return () => {
clearInterval(id);

View File

@ -7,7 +7,12 @@ import {
} from '@solana/web3.js';
import { useMemo } from 'react';
import { utils, ParsedAccount, useConnectionConfig, cache } from '@oyster/common';
import {
utils,
ParsedAccount,
useConnectionConfig,
cache,
} from '@oyster/common';
import {
CustomSingleSignerTimelockTransactionLayout,
CustomSingleSignerTimelockTransactionParser,
@ -146,7 +151,7 @@ function useSetupProposalsCache({
return () => {
connection.removeProgramAccountChangeListener(subID);
};
}, [connection, PROGRAM_IDS.timelock.programAccountId]);
}, [connection, PROGRAM_IDS.timelock.programAccountId.toBase58()]);
}
export const useProposals = () => {
const context = useContext(ProposalsContext);
@ -155,9 +160,9 @@ export const useProposals = () => {
export const useConfig = (id: string) => {
const context = useContext(ProposalsContext);
if(!context?.configs) {
if (!context?.configs) {
return;
}
return context.configs[id];
}
};