Skip to content

Commit

Permalink
autobuy: handle cron error
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Dec 16, 2024
1 parent 93bb7a3 commit f1161b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/strategy/autobuy/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
})

s.cron = cron.New()
s.cron.AddFunc(s.Schedule, func() {
_, err := s.cron.AddFunc(s.Schedule, func() {
s.autobuy(ctx)
})
if err != nil {
return err
}

s.cron.Start()

return nil
Expand Down

0 comments on commit f1161b2

Please sign in to comment.