Permalink
Browse files

Switches process loop toggle, again

  • Loading branch information...
jacobemerick committed Jul 28, 2017
1 parent 5724760 commit 260751a21465b3aa8166848cae53553792159115
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/Cron/Distance.php
View
@@ -35,9 +35,9 @@ public function __construct(Container $container)
public function run()
{
$page = 1;
$unprocessedEntry = true;
$makeNewRequest = true;
while ($unprocessedEntry) {
while ($makeNewRequest) {
try {
$username = $this->container->get('config')->distance->username;
$entries = $this->fetchEntries($this->container->get('distanceClient'), $username, $page);
@@ -46,15 +46,17 @@ public function run()
return;
}
$makeNewRequest = false;
$this->logger->debug("Processing page {$page} of api results");
foreach ($entries as $entry) {
$entryExists = $this->checkEntryExists($this->container->get('distanceModel'), $entry->id);
if ($entryExists) {
$unprocessedEntry = false;
$makeNewRequest = false;
continue;
}
$fetchEntries = true;
try {
$this->insertEntry(
$this->container->get('distanceModel'),

0 comments on commit 260751a

Please sign in to comment.