Skip to content

Commit

Permalink
mm: Close book feeds
Browse files Browse the repository at this point in the history
Book feeds were not being closed, leading to warning logs.
  • Loading branch information
martonp committed Aug 11, 2024
1 parent 1efedb4 commit 72df9f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/mm/exchange_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,7 @@ func (u *unifiedExchangeAdaptor) cancelAllOrders(ctx context.Context) {
u.tryCancelOrders(ctx, nil, true)
return
}
defer bookFeed.Close()

mktCfg, err := u.clientCore.ExchangeMarket(u.host, u.baseID, u.quoteID)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions client/mm/mm_arb_market_maker.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ func (a *arbMarketMaker) botLoop(ctx context.Context) (*sync.WaitGroup, error) {
a.rebalance(epoch.Current)
}
case <-ctx.Done():
bookFeed.Close()
return
}
}
Expand Down
1 change: 1 addition & 0 deletions client/mm/mm_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ func (m *basicMarketMaker) botLoop(ctx context.Context) (*sync.WaitGroup, error)
m.rebalance(epoch.Current)
}
case <-ctx.Done():
bookFeed.Close()
return
}
}
Expand Down
1 change: 1 addition & 0 deletions client/mm/mm_simple_arb.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ func (a *simpleArbMarketMaker) botLoop(ctx context.Context) (*sync.WaitGroup, er
a.rebalance(epoch.Current)
}
case <-ctx.Done():
bookFeed.Close()
return
}
}
Expand Down

0 comments on commit 72df9f8

Please sign in to comment.