mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
Merge pull request #442 from kkc/fix_bollmaker_backtest
Fix: fallback to memory persistence if redis not found
This commit is contained in:
commit
e4b4f69716
|
@ -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