|
|
@@ -89,6 +89,8 @@ void ThreadedAnalyticsDestination::EventDispatcher::run() |
|
|
while (! threadShouldExit())
|
|
|
while (! threadShouldExit())
|
|
|
{
|
|
|
{
|
|
|
{
|
|
|
{
|
|
|
|
|
|
const ScopedLock lock (queueAccess);
|
|
|
|
|
|
|
|
|
const auto numEventsInBatch = eventsToSend.size();
|
|
|
const auto numEventsInBatch = eventsToSend.size();
|
|
|
const auto freeBatchCapacity = maxBatchSize - numEventsInBatch;
|
|
|
const auto freeBatchCapacity = maxBatchSize - numEventsInBatch;
|
|
|
|
|
|
|
|
|
@@ -98,8 +100,6 @@ void ThreadedAnalyticsDestination::EventDispatcher::run() |
|
|
|
|
|
|
|
|
if (numNewEvents > 0)
|
|
|
if (numNewEvents > 0)
|
|
|
{
|
|
|
{
|
|
|
const ScopedLock lock (queueAccess);
|
|
|
|
|
|
|
|
|
|
|
|
const auto numEventsToAdd = jmin (numNewEvents, freeBatchCapacity);
|
|
|
const auto numEventsToAdd = jmin (numNewEvents, freeBatchCapacity);
|
|
|
const auto newBatchSize = numEventsInBatch + numEventsToAdd;
|
|
|
const auto newBatchSize = numEventsInBatch + numEventsToAdd;
|
|
|
|
|
|
|
|
|
|