mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
move emitStart method call into the stream Connect method
This commit is contained in:
parent
7951c38edc
commit
2f7c7d344b
|
@ -490,8 +490,6 @@ func (environ *Environment) Connect(ctx context.Context) error {
|
|||
if err := session.Stream.Connect(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
session.Stream.EmitStart()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -310,6 +310,8 @@ func (s *Stream) Connect(ctx context.Context) error {
|
|||
}
|
||||
|
||||
go s.read(ctx)
|
||||
|
||||
s.EmitStart()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -171,7 +171,13 @@ func (s *Stream) Subscribe(channel types.Channel, symbol string, options types.S
|
|||
}
|
||||
|
||||
func (s *Stream) Connect(ctx context.Context) error {
|
||||
return s.websocketService.Connect(ctx)
|
||||
err := s.websocketService.Connect(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s.EmitStart()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Stream) Close() error {
|
||||
|
|
Loading…
Reference in New Issue
Block a user