mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fix persistence unmarshalling issue
This commit is contained in:
parent
221a2d9dc7
commit
c20e3fee4b
|
@ -72,9 +72,6 @@ func iterateFieldsByTag(obj interface{}, tagName string, cb StructFieldIterator)
|
|||
fv := sv.Field(i)
|
||||
ft := st.Field(i)
|
||||
|
||||
fvt := fv.Type()
|
||||
_ = fvt
|
||||
|
||||
// skip unexported fields
|
||||
if !st.Field(i).IsExported() {
|
||||
continue
|
||||
|
|
|
@ -63,7 +63,8 @@ func (store *RedisStore) Load(val interface{}) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if len(data) == 0 {
|
||||
// skip null data
|
||||
if len(data) == 0 || data == "null" {
|
||||
return ErrPersistenceNotExists
|
||||
}
|
||||
|
||||
|
|
|
@ -216,6 +216,10 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
s.Position = types.NewPositionFromMarket(s.Market)
|
||||
}
|
||||
|
||||
if s.ProfitStats == nil {
|
||||
s.ProfitStats = types.NewProfitStats(s.Market)
|
||||
}
|
||||
|
||||
instanceID := s.InstanceID()
|
||||
|
||||
// Always update the position fields
|
||||
|
|
Loading…
Reference in New Issue
Block a user