Skip to content

Commit d2f8eb7

Browse files
msohailhussainMichael Ng
authored andcommitted
fix(EP): Event processor fixes (#193)
1 parent b8dc00e commit d2f8eb7

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

OptimizelySDK.Tests/EventTests/BatchEventProcessorTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ class BatchEventProcessorTest
2828
private Mock<ILogger> LoggerMock;
2929
private BlockingCollection<object> eventQueue;
3030
private BatchEventProcessor EventProcessor;
31-
private Mock<IEventDispatcher> EventDispatcherMock;
32-
private TestEventDispatcher TestEventDispatcher;
31+
private Mock<IEventDispatcher> EventDispatcherMock;
3332
private NotificationCenter NotificationCenter = new NotificationCenter();
3433
private Mock<TestNotificationCallbacks> NotificationCallbackMock;
3534

OptimizelySDK/Event/BatchEventProcessor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public void Flush()
145145

146146
private void FlushQueue()
147147
{
148+
FlushingIntervalDeadline = DateTime.Now.MillisecondsSince1970() + (long)FlushInterval.TotalMilliseconds;
149+
148150
if (CurrentBatch.Count == 0)
149151
{
150152
return;
@@ -350,8 +352,8 @@ public BatchEventProcessor Build(bool start)
350352
batchEventProcessor.NotificationCenter = NotificationCenter;
351353

352354
batchEventProcessor.BatchSize = BatchSize < 1 ? BatchEventProcessor.DEFAULT_BATCH_SIZE : BatchSize;
353-
batchEventProcessor.FlushInterval = FlushInterval < TimeSpan.FromSeconds(1) ? BatchEventProcessor.DEFAULT_FLUSH_INTERVAL : FlushInterval;
354-
batchEventProcessor.TimeoutInterval = TimeoutInterval < TimeSpan.FromSeconds(1) ? BatchEventProcessor.DEFAULT_TIMEOUT_INTERVAL : TimeoutInterval;
355+
batchEventProcessor.FlushInterval = FlushInterval <= TimeSpan.FromSeconds(0) ? BatchEventProcessor.DEFAULT_FLUSH_INTERVAL : FlushInterval;
356+
batchEventProcessor.TimeoutInterval = TimeoutInterval <= TimeSpan.FromSeconds(0) ? BatchEventProcessor.DEFAULT_TIMEOUT_INTERVAL : TimeoutInterval;
355357

356358
if (start)
357359
batchEventProcessor.Start();

OptimizelySDK/Event/Entity/EventContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public class Builder
4848
private string AccountId;
4949
private string ProjectId;
5050
private string Revision;
51-
private string ClientName;
52-
private string ClientVersion;
5351
private bool AnonymizeIP;
5452

5553
public Builder WithAccountId(string accountId)

OptimizelySDK/Event/Entity/ImpressionEvent.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ public class ImpressionEvent : UserEvent
3636
/// </summary>
3737
public class Builder
3838
{
39-
private string UserId;
40-
private string UUID;
41-
private long Timestamp;
39+
private string UserId;
4240
private EventContext EventContext;
4341

4442
public VisitorAttribute[] VisitorAttributes;

0 commit comments

Comments
 (0)