fix: change from local timezone to UTC when do syncing

This commit is contained in:
zenix 2022-06-02 17:12:17 +09:00
parent 38a6d8c813
commit 5faab1d55c
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ func NewEnvironment() *Environment {
// default trade scan time // default trade scan time
syncStartTime: time.Now().AddDate(-1, 0, 0), // defaults to sync from 1 year ago syncStartTime: time.Now().AddDate(-1, 0, 0), // defaults to sync from 1 year ago
sessions: make(map[string]*ExchangeSession), sessions: make(map[string]*ExchangeSession),
startTime: time.Now(), startTime: time.Now().UTC(),
syncStatus: SyncNotStarted, syncStatus: SyncNotStarted,
PersistenceServiceFacade: &service.PersistenceServiceFacade{ PersistenceServiceFacade: &service.PersistenceServiceFacade{

View File

@ -24,7 +24,7 @@ func (e *KLineBatchQuery) Query(ctx context.Context, symbol string, interval typ
}) })
}, },
T: func(obj interface{}) time.Time { T: func(obj interface{}) time.Time {
return time.Time(obj.(types.KLine).StartTime) return time.Time(obj.(types.KLine).StartTime).UTC()
}, },
ID: func(obj interface{}) string { ID: func(obj interface{}) string {
kline := obj.(types.KLine) kline := obj.(types.KLine)