Removed the concept of API limits in IP location resolvers

This commit is contained in:
Alejandro Celaya
2018-11-11 13:04:41 +01:00
parent b530cf4461
commit d152e2ef9a
5 changed files with 0 additions and 108 deletions

View File

@@ -13,7 +13,6 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Zend\I18n\Translator\TranslatorInterface;
use function sleep;
use function sprintf;
class ProcessVisitsCommand extends Command
@@ -57,7 +56,6 @@ class ProcessVisitsCommand extends Command
$io = new SymfonyStyle($input, $output);
$visits = $this->visitService->getUnlocatedVisits();
$count = 0;
foreach ($visits as $visit) {
if (! $visit->hasRemoteAddr()) {
$io->writeln(
@@ -76,7 +74,6 @@ class ProcessVisitsCommand extends Command
continue;
}
$count++;
try {
$result = $this->ipLocationResolver->resolveIpLocation($ipAddr);
@@ -99,16 +96,6 @@ class ProcessVisitsCommand extends Command
$this->getApplication()->renderException($e, $output);
}
}
if ($count === $this->ipLocationResolver->getApiLimit()) {
$count = 0;
$seconds = $this->ipLocationResolver->getApiInterval();
$io->note(sprintf(
$this->translator->translate('IP location resolver limit reached. Waiting %s seconds...'),
$seconds
));
sleep($seconds);
}
}
$io->success($this->translator->translate('Finished processing all IPs'));