mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: call TryLock in updateGridNumOfOrdersMetricsWithLock
This commit is contained in:
parent
5c5543d78a
commit
fc7edc5c80
|
@ -1179,7 +1179,11 @@ func (s *Strategy) updateFilledOrderMetrics(order types.Order) {
|
|||
}
|
||||
|
||||
func (s *Strategy) updateGridNumOfOrdersMetricsWithLock() {
|
||||
s.updateGridNumOfOrdersMetrics(s.getGrid())
|
||||
if s.mu.TryLock() {
|
||||
grid := s.grid
|
||||
s.mu.Unlock()
|
||||
s.updateGridNumOfOrdersMetrics(grid)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Strategy) updateGridNumOfOrdersMetrics(grid *Grid) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user