Skip to content

Commit 123ef93

Browse files
committed
Update Http.php
1 parent 25979fc commit 123ef93

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Discord/Http.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,11 @@ protected function getBucket(string $key): Bucket
478478
* Checks the request queue to see if more requests can be
479479
* sent out.
480480
*/
481-
protected function checkQueue(): void
481+
protected function checkQueue(bool $check_interactions = true): void
482482
{
483-
$this->checkInteractionQueue();
483+
if ($check_interactions) {
484+
$this->checkInteractionQueue();
485+
}
484486

485487
if ($this->waiting >= static::CONCURRENT_REQUESTS || $this->queue->isEmpty()) {
486488
$this->logger->debug('http not checking queue', ['waiting' => $this->waiting, 'empty' => $this->queue->isEmpty()]);
@@ -497,11 +499,11 @@ protected function checkQueue(): void
497499

498500
$this->executeRequest($request)->then(function ($result) use ($deferred) {
499501
--$this->waiting;
500-
$this->checkQueue();
502+
$this->checkQueue(false);
501503
$deferred->resolve($result);
502504
}, function ($e) use ($deferred) {
503505
--$this->waiting;
504-
$this->checkQueue();
506+
$this->checkQueue(false);
505507
$deferred->reject($e);
506508
});
507509
}

0 commit comments

Comments
 (0)