| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function onCrawlPreRequest(GenericEvent $event) |
||
| 32 | { |
||
| 33 | $currentHostname = $event->getArgument('uri')->getHost(); |
||
| 34 | |||
| 35 | if ($currentHostname === $this->previousHostname) { |
||
| 36 | $this->totalDelay = $this->totalDelay + $this->requestDelay; |
||
| 37 | usleep($this->requestDelay); |
||
| 38 | } |
||
| 39 | $this->previousHostname = $currentHostname; |
||
| 40 | } |
||
| 42 |