Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
perf(wallet): throttling channel refetch to once per minute
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 10, 2020
1 parent 69ca996 commit 3c1786c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion renderer/reducers/channels/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const {
RECEIVE_SUGGESTED_NODES,
} = constants

const CHANNEL_REFRESH_THROTTLE = 1000 * 60

// ------------------------------------
// Initial State
// ------------------------------------
Expand Down Expand Up @@ -513,7 +515,7 @@ const throttledFetchChannels = throttle(
dispatch(fetchChannels())
dispatch(fetchBalance())
},
1000,
CHANNEL_REFRESH_THROTTLE,
{
leading: true,
trailing: true,
Expand Down
2 changes: 1 addition & 1 deletion renderer/reducers/payment/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export const payInvoice = ({
}

/**
* receiveHtlcEventData - Listener for when a new transaction is pushed from the subscriber.
* receiveHtlcEventData - Listener for when a new htlc event is pushed from the subscriber.
*
* @param {HtlcEvent} htlcEvent HtlcEvent
* @returns {(dispatch:Function, getState:Function) => void} Thunk
Expand Down

0 comments on commit 3c1786c

Please sign in to comment.