Skip to content

Commit

Permalink
Merge pull request QuantConnect#3960 from QuantConnect/bug-3951-reduc…
Browse files Browse the repository at this point in the history
…e-logging

Reduce logging in InteractiveBrokersBrokerage.IsWithinScheduledServerResetTimes
  • Loading branch information
jaredbroad authored Jan 2, 2020
2 parents aa2f875 + 2fbff97 commit 571fa49
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Brokerages/InteractiveBrokers/InteractiveBrokersBrokerage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ private enum Region { America, Europe, Asia }
// IB requests made through the IB-API must be limited to a maximum of 50 messages/second
private readonly RateGate _messagingRateLimiter = new RateGate(50, TimeSpan.FromSeconds(1));

// used for reconnection attempts
private bool _previouslyInResetTime;
// used to limit logging
private bool _isWithinScheduledServerResetTimesLastValue;

// additional IB request information, will be matched with errors in the handler, for better error reporting
private readonly ConcurrentDictionary<int, string> _requestInformation = new ConcurrentDictionary<int, string>();
Expand Down Expand Up @@ -2358,7 +2361,12 @@ private bool IsWithinScheduledServerResetTimes()
}
}

Log.Trace("InteractiveBrokersBrokerage.IsWithinScheduledServerResetTimes(): " + result);
if (result != _isWithinScheduledServerResetTimesLastValue)
{
_isWithinScheduledServerResetTimesLastValue = result;

Log.Trace($"InteractiveBrokersBrokerage.IsWithinScheduledServerResetTimes(): {result}");
}

return result;
}
Expand Down

0 comments on commit 571fa49

Please sign in to comment.