mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
orderStore: remove only filled orders and canceled orders
This commit is contained in:
parent
5fbb06639d
commit
7f0b8f38d5
|
@ -147,9 +147,11 @@ func (s *OrderStore) Prune(expiryDuration time.Duration) {
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
|
||||||
for idx, o := range s.orders {
|
for idx, o := range s.orders {
|
||||||
|
if o.Status == types.OrderStatusCanceled || o.Status == types.OrderStatusFilled {
|
||||||
if o.UpdateTime.Time().Before(cutOffTime) {
|
if o.UpdateTime.Time().Before(cutOffTime) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
orders[idx] = o
|
orders[idx] = o
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user