Skip to content

Commit

Permalink
Revert "Respect request delay"
Browse files Browse the repository at this point in the history
This reverts commit ef3115f.
  • Loading branch information
David Racovan committed Jul 30, 2024
1 parent ef3115f commit ae09480
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Handlers/CrawlRequestFulfilled.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function __invoke(ResponseInterface $response, $index)

$this->crawler->getCrawlObservers()->crawlFailed($crawlUrl, $exception);

usleep($this->crawler->getDelayBetweenRequests());
return;
}

Expand All @@ -65,13 +64,13 @@ public function __invoke(ResponseInterface $response, $index)
$this->handleCrawled($responseWithCachedBody, $crawlUrl);
}

if (!$this->crawler->getCrawlProfile() instanceof CrawlSubdomains) {
if (! $this->crawler->getCrawlProfile() instanceof CrawlSubdomains) {
if ($crawlUrl->url->getHost() !== $this->crawler->getBaseUrl()->getHost()) {
return;
}
}

if (!$robots->mayFollow()) {
if (! $robots->mayFollow()) {
return;
}

Expand Down Expand Up @@ -103,7 +102,7 @@ protected function getBody(ResponseInterface $response): string
{
$contentType = $response->getHeaderLine('Content-Type');

if (!$this->isMimetypeAllowedToParse($contentType)) {
if (! $this->isMimetypeAllowedToParse($contentType)) {
return '';
}

Expand All @@ -127,7 +126,7 @@ protected function convertBodyToString(StreamInterface $bodyStream, $readMaximum
$newDataRead = null;
}

if (!$newDataRead) {
if (! $newDataRead) {
break;
}

Expand All @@ -152,7 +151,7 @@ protected function isMimetypeAllowedToParse($contentType): bool
return true;
}

if (!count($this->crawler->getParseableMimeTypes())) {
if (! count($this->crawler->getParseableMimeTypes())) {
return true;
}

Expand Down

0 comments on commit ae09480

Please sign in to comment.