Skip to content

Commit 5df7cfb

Browse files
mfahadahmedkellyroach-optimizely
authored andcommitted
Eventdispatcherissue (#35) (#54)
Fixed Timing issue with Activate() & Track() being called sequentially
1 parent 49b7e5d commit 5df7cfb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

OptimizelySDK/Event/Dispatcher/HttpClientEventDispatcher45.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static HttpClientEventDispatcher45()
4141
/// <summary>
4242
/// Dispatch an Event asynchronously
4343
/// </summary>
44-
private async void DispatchEventAsync(LogEvent logEvent)
44+
private async Task DispatchEventAsync(LogEvent logEvent)
4545
{
4646
try
4747
{
@@ -68,13 +68,11 @@ private async void DispatchEventAsync(LogEvent logEvent)
6868
}
6969

7070
/// <summary>
71-
/// Dispatch an event Asynchronously by creating a new task and calls the
72-
/// Async version of DispatchEvent
73-
/// This is a "Fire and Forget" option
71+
/// Dispatch an event
7472
/// </summary>
7573
public void DispatchEvent(LogEvent logEvent)
7674
{
77-
Task.Run(() => DispatchEventAsync(logEvent));
75+
Task.Run(() => DispatchEventAsync(logEvent)).Wait();
7876
}
7977
}
8078
}

0 commit comments

Comments
 (0)