Skip to content

Commit 3388bed

Browse files
authored
Merge pull request #193 from backtrace-labs/gm4sl/metrics-send-pending
metrics: fix for pending jobs being delayed one or more frames
2 parents 0f52d96 + a02386a commit 3388bed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Runtime/Model/Metrics/MetricsSubmissionQueue.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,18 @@ internal void SendPayload(ICollection<T> events, uint attempts = 0)
138138

139139
public void SendPendingEvents(float time)
140140
{
141-
for (int index = 0; index < _submissionJobs.Count; index++)
141+
for (int index = 0; index < _submissionJobs.Count; )
142142
{
143143
var submissionJob = _submissionJobs.ElementAt(index);
144144
if (submissionJob.NextInvokeTime < time)
145145
{
146146
SendPayload(submissionJob.Events, submissionJob.NumberOfAttempts);
147147
_submissionJobs.RemoveAt(index);
148148
}
149+
else
150+
{
151+
index++;
152+
}
149153
}
150154
}
151155

0 commit comments

Comments
 (0)