From 5f18b89dfa6475211f44b2b6e1fc7c6b90db0cb5 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 28 May 2021 19:01:55 +0800 Subject: [PATCH] if publicOnly is set, we should not connect user data stream --- pkg/bbgo/environment.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/bbgo/environment.go b/pkg/bbgo/environment.go index b2fb4c9ab..ef4848c47 100644 --- a/pkg/bbgo/environment.go +++ b/pkg/bbgo/environment.go @@ -519,9 +519,11 @@ func (environ *Environment) Connect(ctx context.Context) error { return err } - logger.Infof("connecting %s user data stream...", session.Name) - if err := session.UserDataStream.Connect(ctx); err != nil { - return err + if !session.PublicOnly { + logger.Infof("connecting %s user data stream...", session.Name) + if err := session.UserDataStream.Connect(ctx); err != nil { + return err + } } }