mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
orderStore: remove only filled orders and canceled orders
This commit is contained in:
parent
5fbb06639d
commit
7f0b8f38d5
|
@ -147,8 +147,10 @@ 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.UpdateTime.Time().Before(cutOffTime) {
|
if o.Status == types.OrderStatusCanceled || o.Status == types.OrderStatusFilled {
|
||||||
continue
|
if o.UpdateTime.Time().Before(cutOffTime) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
orders[idx] = o
|
orders[idx] = o
|
||||||
|
|
Loading…
Reference in New Issue
Block a user