From fe7495898f564b794546ee8a7705be96530a75d2 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 8 Dec 2020 15:09:17 +0800 Subject: [PATCH] check if persistence is configured --- pkg/cmd/run.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index 4f17f8e5a..8c10a3514 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -148,7 +148,10 @@ func runConfig(basectx context.Context, userConfig *bbgo.Config) error { } var options []telegramnotifier.NotifyOption - options = append(options, telegramnotifier.WithRedisPersistence(environ.PersistenceServiceFacade.Redis)) + + if environ.PersistenceServiceFacade != nil && environ.PersistenceServiceFacade.Redis != nil { + options = append(options, telegramnotifier.WithRedisPersistence(environ.PersistenceServiceFacade.Redis)) + } log.Infof("send the following command to the bbgo bot you created to enable the notification...") log.Infof("===========================================")