Skip to content

Commit

Permalink
Change vars from static to instance in JobQueue
Browse files Browse the repository at this point in the history
When running consecutive algorithms, this was causing the algorithm runner to look for the wrong file name.
  • Loading branch information
StefanoRaggi committed Jul 3, 2018
1 parent dbb6561 commit 483f20c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Queues/JobQueue.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -39,8 +39,8 @@ public class JobQueue : IJobQueueHandler
private static readonly string AccessToken = Config.Get("api-access-token");
private static readonly int UserId = Config.GetInt("job-user-id", 0);
private static readonly int ProjectId = Config.GetInt("job-project-id", 0);
private static readonly string AlgorithmTypeName = Config.Get("algorithm-type-name");
private static readonly string AlgorithmPathPython = Config.Get("algorithm-path-python", "../../../Algorithm.Python/");
private readonly string AlgorithmTypeName = Config.Get("algorithm-type-name");
private readonly string AlgorithmPathPython = Config.Get("algorithm-path-python", "../../../Algorithm.Python/");
private readonly Language Language = (Language)Enum.Parse(typeof(Language), Config.Get("algorithm-language"));

/// <summary>
Expand All @@ -51,7 +51,7 @@ private string AlgorithmLocation
get
{
// we expect this dll to be copied into the output directory
return Config.Get("algorithm-location", "QuantConnect.Algorithm.CSharp.dll");
return Config.Get("algorithm-location", "QuantConnect.Algorithm.CSharp.dll");
}
}

Expand All @@ -62,19 +62,19 @@ public void Initialize(IApi api)
{
//
}

/// <summary>
/// Desktop/Local Get Next Task - Get task from the Algorithm folder of VS Solution.
/// </summary>
/// <returns></returns>
public AlgorithmNodePacket NextJob(out string location)
{
location = GetAlgorithmLocation();

Log.Trace("JobQueue.NextJob(): Selected " + location);

// check for parameters in the config
var parameters = new Dictionary<string, string>();
var parameters = new Dictionary<string, string>();

var parametersConfigString = Config.Get("parameters");
if (parametersConfigString != string.Empty)
Expand Down Expand Up @@ -111,7 +111,7 @@ public AlgorithmNodePacket NextJob(out string location)
};

try
{
{
// import the brokerage data for the configured brokerage
var brokerageFactory = Composer.Instance.Single<IBrokerageFactory>(factory => factory.BrokerageType.MatchesTypeName(liveJob.Brokerage));
liveJob.BrokerageData = brokerageFactory.BrokerageData;
Expand Down

0 comments on commit 483f20c

Please sign in to comment.