File tree 1 file changed +9
-5
lines changed
QuantConnect.AlpacaBrokerage
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
- /*
1
+ /*
2
2
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3
3
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4
4
*
@@ -654,10 +654,14 @@ private void RunReconnectionLogic(int secondsDelay)
654
654
}
655
655
else
656
656
{
657
- // resubscribe
658
- var symbols = _subscriptionManager . GetSubscribedSymbols ( ) ;
659
- Unsubscribe ( symbols ) ;
660
- Subscribe ( symbols ) ;
657
+ // if we are used as a brokerage ignore data queue handler updates
658
+ if ( _subscriptionManager != null )
659
+ {
660
+ // resubscribe
661
+ var symbols = _subscriptionManager . GetSubscribedSymbols ( ) ;
662
+ Unsubscribe ( symbols ) ;
663
+ Subscribe ( symbols ) ;
664
+ }
661
665
// let consumers know we are reconnected, avoid lean killing us
662
666
OnMessage ( new BrokerageMessageEvent ( BrokerageMessageType . Reconnect , "Reconnected" , "Brokerage Reconnected" ) ) ;
663
667
}
You can’t perform that action at this time.
0 commit comments