Hi,
I just found that prunePendingRequestQueue does not work as it should, it always return empty list because of a bug in getNextPendingRequests. Please see this code:
private function getNextPendingRequests($limit = 1)
{
$requests = array();
while ($limit--) {
if (!isset($this->pendingRequests[$this->pendingRequestsPosition])) {
break;
}
$requests[] = $this->pendingRequests[$this->pendingRequestsPosition];
$this->pendingRequestsPosition++;
}
return $requests;
}
If $limit is 0, the while loop will never run. I propose this patch to fix this bug:
- while ($limit--) {
+ $countPending = $limit <= 0 ? $this->countPending() : $limit;
+ while ($countPending--) {
Hi,
I just found that
prunePendingRequestQueuedoes not work as it should, it always return empty list because of a bug ingetNextPendingRequests. Please see this code:If
$limitis 0, thewhileloop will never run. I propose this patch to fix this bug: