Skip to content

Commit

Permalink
Import: we now skip messages when user is null
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosomb committed Feb 20, 2017
1 parent 48be826 commit b45b6b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ protected function handleMessage($body)
if (null === $user) {
$this->logger->warning('Unable to retrieve user', ['entry' => $storedEntry]);

return false;
// return true to skip message
return true;
}

$this->import->setUser($user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ public function testMessageWithBadUser()

$message = new AMQPMessage($body);

$consumer->execute($message);
$res = $consumer->execute($message);

$this->assertTrue($res);
}

public function testMessageWithEntryProcessed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function testMessageWithBadUser()

$res = $consumer->manage($body);

$this->assertFalse($res);
$this->assertTrue($res);
}

public function testMessageWithEntryProcessed()
Expand Down

0 comments on commit b45b6b6

Please sign in to comment.