Skip to content

Commit

Permalink
ui: fix slow forwarding history
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed May 3, 2024
1 parent 0ebd8df commit c88d549
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions ui/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,14 @@ func (c *controller) Listen(ctx context.Context, g *gocui.Gui, sub chan *events.
c.models.RefreshInfo,
c.models.RefreshWalletBalance,
c.models.RefreshTransactions,
c.models.RefreshForwardingHistory,
)
case events.ChannelBalanceUpdated:
refresh(
c.models.RefreshInfo,
c.models.RefreshChannelsBalance,
c.models.RefreshChannels,
c.models.RefreshForwardingHistory,
)
case events.ChannelPending:
refresh(
Expand All @@ -174,11 +176,19 @@ func (c *controller) Listen(ctx context.Context, g *gocui.Gui, sub chan *events.
c.models.RefreshInfo,
c.models.RefreshChannelsBalance,
c.models.RefreshChannels,
c.models.RefreshForwardingHistory,
)
case events.PeerUpdated:
refresh(c.models.RefreshInfo)
refresh(
c.models.RefreshInfo,
c.models.RefreshForwardingHistory,
)

case events.RoutingEventUpdated:
refresh(c.models.RefreshRouting(event.Data))
refresh(
c.models.RefreshRouting(event.Data),
c.models.RefreshForwardingHistory,
)
case events.GraphUpdated:
refresh(c.models.RefreshPolicies(event.Data))
}
Expand Down Expand Up @@ -300,9 +310,7 @@ func (c *controller) OnEnter(g *gocui.Gui, v *gocui.View) error {
if err != nil {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), time.Second*60)
defer cancel()
c.models.RefreshForwardingHistory(ctx)

c.views.Main = c.views.FwdingHist
err = c.views.FwdingHist.Set(g, 11, 6, maxX-1, maxY)
if err != nil {
Expand Down

0 comments on commit c88d549

Please sign in to comment.