Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NomanShoaib committed Aug 2, 2023
1 parent 43c9308 commit 745e361
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,20 @@ public void TestTimedoutOnlyIfSchedulerStarted()
[Test]
public void TestWarnLogIfPollingTimeIsLessThanThirty()
{
// period to call is 29 milliseconds
var configManager = new TestPollingProjectConfigManager(TimeSpan.FromMilliseconds(29),
TimeSpan.FromMilliseconds(20), true, LoggerMock.Object, new int[] { });
var below30Seconds = TimeSpan.FromSeconds(29);
_ = new TestPollingProjectConfigManager(below30Seconds,
TimeSpan.FromSeconds(10), true, LoggerMock.Object, new int[] { });
LoggerMock.Verify(l => l.Log(LogLevel.WARN,
"Polling intervals below 30 seconds are not recommended."), Times.Once);
}

[Test]
public void TestWarnLogNotTriggeredIfPollingTimeIsGreaterThanThirty()
{
// period to call is 32 second
var configManager = new TestPollingProjectConfigManager(TimeSpan.FromSeconds(32),
TimeSpan.FromMilliseconds(31), true, LoggerMock.Object, new int[] { });
var above30Seconds = TimeSpan.FromMinutes(1);
_ = new TestPollingProjectConfigManager(above30Seconds,
TimeSpan.FromMilliseconds(10), true, LoggerMock.Object, new int[] { });
LoggerMock.Verify(l => l.Log(LogLevel.WARN,
"Polling intervals below 30 seconds are not recommended."), Times.Once);
"Polling intervals below 30 seconds are not recommended."), Times.Never);
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion OptimizelySDK/Config/PollingProjectConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public PollingProjectConfigManager(TimeSpan period, TimeSpan blockingTimeout,
Logger = logger;
ErrorHandler = errorHandler;
BlockingTimeout = blockingTimeout;
if (period.TotalMilliseconds < 30)
if (period.Seconds < 30)
{
Logger?.Log(LogLevel.WARN, "Polling intervals below 30 seconds are not recommended.");
}
Expand Down

0 comments on commit 745e361

Please sign in to comment.