Skip to content

Commit

Permalink
feat: use global instead of Config in ValidateSubscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Feb 21, 2024
1 parent f6ee567 commit 4c1403f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions QuantConnect.IEX/IEXDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ public void SetJob(LiveNodePacket job)
/// <param name="pricePlan">iex price plan <see cref="IEXPricePlan"/></param>
private void Initialize(string apiKey, string pricePlan)
{
ValidateSubscription();

_apiKey = apiKey;

if (!Enum.TryParse<IEXPricePlan>(pricePlan, out var parsedPricePlan) || !Enum.IsDefined(typeof(IEXPricePlan), parsedPricePlan))
Expand All @@ -408,8 +410,6 @@ private void Initialize(string apiKey, string pricePlan)
_subscriptionManager.SubscribeImpl += Subscribe;
_subscriptionManager.UnsubscribeImpl += Unsubscribe;

ValidateSubscription();

// Set the sse-clients collection
foreach (var channelName in IEXDataStreamChannels.Subscriptions)
{
Expand Down Expand Up @@ -741,9 +741,9 @@ private static void ValidateSubscription()
try
{
const int productId = 333;
var userId = Config.GetInt("job-user-id");
var token = Config.Get("api-access-token");
var organizationId = Config.Get("job-organization-id", null);
var userId = Globals.UserId;
var token = Globals.UserToken;
var organizationId = Globals.OrganizationID;
// Verify we can authenticate with this user and token
var api = new ApiConnection(userId, token);
if (!api.Connected)
Expand Down

0 comments on commit 4c1403f

Please sign in to comment.