From fb5fc02bdff42ab9d7dff8da67971a53b92be69a Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 8 Jun 2022 12:54:48 +0800 Subject: [PATCH] fix since time field check --- pkg/bbgo/environment.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/bbgo/environment.go b/pkg/bbgo/environment.go index 76b63fd26..cc9023c06 100644 --- a/pkg/bbgo/environment.go +++ b/pkg/bbgo/environment.go @@ -587,7 +587,10 @@ func (environ *Environment) syncWithUserConfig(ctx context.Context, userConfig * sessions = environ.SelectSessions(selectedSessions...) } - since := userConfig.Sync.Since.Time() + since := time.Now().AddDate(0, -6, 0) + if userConfig.Sync.Since != nil { + since = userConfig.Sync.Since.Time() + } for _, session := range sessions { if err := environ.syncSession(ctx, session, syncSymbols...); err != nil {