@@ -79,9 +79,10 @@ public Engine(LeanEngineSystemHandlers systemHandlers, LeanEngineAlgorithmHandle
79
79
/// Runs a single backtest/live job from the job queue
80
80
/// </summary>
81
81
/// <param name="job">The algorithm job to be processed</param>
82
- /// <param name="manager"></param>
82
+ /// <param name="manager">The algorithm manager instance </param>
83
83
/// <param name="assemblyPath">The path to the algorithm's assembly</param>
84
- public void Run ( AlgorithmNodePacket job , AlgorithmManager manager , string assemblyPath )
84
+ /// <param name="workerThread">The worker thread instance</param>
85
+ public void Run ( AlgorithmNodePacket job , AlgorithmManager manager , string assemblyPath , WorkerThread workerThread )
85
86
{
86
87
var marketHoursDatabaseTask = Task . Run ( ( ) => StaticInitializations ( ) ) ;
87
88
@@ -96,7 +97,6 @@ public void Run(AlgorithmNodePacket job, AlgorithmManager manager, string assemb
96
97
Thread threadResults = null ;
97
98
Thread threadRealTime = null ;
98
99
Thread threadAlphas = null ;
99
- WorkerThread workerThread = null ;
100
100
101
101
//-> Initialize messaging system
102
102
SystemHandlers . Notify . SetAuthentication ( job ) ;
@@ -116,8 +116,6 @@ public void Run(AlgorithmNodePacket job, AlgorithmManager manager, string assemb
116
116
// since the algorithm constructor will use it
117
117
var marketHoursDatabase = marketHoursDatabaseTask . Result ;
118
118
119
- // start worker thread
120
- workerThread = new WorkerThread ( ) ;
121
119
AlgorithmHandlers . Setup . WorkerThread = workerThread ;
122
120
123
121
// Save algorithm to cache, load algorithm instance:
0 commit comments