Compare commits
1 commit
commands-f
...
160-regres
Author | SHA1 | Date | |
---|---|---|---|
Bohdan Horbeshko | e55463fc98 |
|
@ -114,10 +114,16 @@ func (sm *StreamManager) Stop() {
|
||||||
|
|
||||||
func (sm *StreamManager) connect() error {
|
func (sm *StreamManager) connect() error {
|
||||||
if sm.client != nil {
|
if sm.client != nil {
|
||||||
if c, ok := sm.client.(*Client); ok {
|
var scs *SyncConnState
|
||||||
if c.CurrentState.getState() == StateDisconnected {
|
if client, ok := sm.client.(*Client); ok {
|
||||||
|
scs = &client.CurrentState
|
||||||
|
}
|
||||||
|
if component, ok := sm.client.(*Component); ok {
|
||||||
|
scs = &component.CurrentState
|
||||||
|
}
|
||||||
|
if scs != nil && scs.getState() == StateDisconnected {
|
||||||
sm.Metrics = initMetrics()
|
sm.Metrics = initMetrics()
|
||||||
err := c.Connect()
|
err := sm.client.Connect()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -127,7 +133,6 @@ func (sm *StreamManager) connect() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return errors.New("client is not disconnected")
|
return errors.New("client is not disconnected")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue