Skip to content

Commit

Permalink
fix: update network metrics store
Browse files Browse the repository at this point in the history
  • Loading branch information
cpl121 committed Mar 18, 2024
1 parent a77a69f commit 11ed758
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/shared/lib/core/network/actions/network-polling.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NETWORK_STATUS_POLL_INTERVAL } from '../constants'
import { getAndUpdateNetworkMetrics } from './getAndUpdateNetworkMetrics'
import { getAndUpdateNodeInfo } from './getAndUpdateNodeInfo'

let pollInterval: number
Expand All @@ -8,8 +9,11 @@ let pollInterval: number
*/
export async function pollNetworkStatus(): Promise<void> {
await getAndUpdateNodeInfo()
await getAndUpdateNodeInfo()
pollInterval = window.setInterval(() => void getAndUpdateNodeInfo(), NETWORK_STATUS_POLL_INTERVAL)
await getAndUpdateNetworkMetrics()
pollInterval = window.setInterval(() => {
getAndUpdateNodeInfo()
getAndUpdateNetworkMetrics()
}, NETWORK_STATUS_POLL_INTERVAL)
}

export function clearNetworkPoll(): void {
Expand Down

0 comments on commit 11ed758

Please sign in to comment.