You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 28, 2019. It is now read-only.
If TrackerManager.DispatchPeriod is set in non zero value, for example 10 seconds, then all hits that were collected from application startup time will be sent every 10 seconds. This is because DispatchAsync() method doesn't clear hits queue for hits that are sent.
Current method's code should be changed to :
public async Task DispatchAsync()
{
if (!isEnabled) return;
Task allDispatchingTasks = null;
lock (dispatchingTasks)
{
if (dispatchingTasks.Any())
{
allDispatchingTasks = Task.WhenAll(dispatchingTasks);
}
}
if (allDispatchingTasks != null)
{
await allDispatchingTasks;
}
if (!isEnabled) return;
Hit[] hitsToSend;
lock (hits)
{
hitsToSend = hits.ToArray();
hits.Clear(); // clear queue.
}
if (hitsToSend.Any())
{
await RunDispatchingTask(DispatchQueuedHits(hitsToSend));
}
}