mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
Fix: fallback to memory persistence if redis not found
resolve #438 Fix bollmaker backtest error
This commit is contained in:
parent
bdd58e5761
commit
cd85edd64d
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/service"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type PersistenceSelector struct {
|
||||
|
@ -27,6 +28,10 @@ func (p *Persistence) backendService(t string) (service.PersistenceService, erro
|
|||
return p.Facade.Json, nil
|
||||
|
||||
case "redis":
|
||||
if p.Facade.Redis == nil {
|
||||
log.Warn("redis persistence is not available, fallback to memory backend")
|
||||
return p.Facade.Memory, nil
|
||||
}
|
||||
return p.Facade.Redis, nil
|
||||
|
||||
case "memory":
|
||||
|
|
Loading…
Reference in New Issue
Block a user