mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
autoborrow: use context timeout handling
This commit is contained in:
parent
7781d5c70f
commit
d6ade1f2fd
|
@ -225,6 +225,12 @@ func (s *Strategy) checkAndBorrow(ctx context.Context) {
|
|||
|
||||
s.tryToRepayAnyDebt(ctx)
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-time.After(time.Second * 5):
|
||||
}
|
||||
|
||||
// update account info after the repay
|
||||
account, err = s.ExchangeSession.UpdateAccount(ctx)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user