Skip to content

Commit

Permalink
Merge pull request #140 from enesaktay/remove-date-check-from-mq-import
Browse files Browse the repository at this point in the history
remove date check on import
  • Loading branch information
lsmith77 authored Jul 25, 2018
2 parents dc65244 + 2d51372 commit 177b996
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/Exporter/MqItemReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,10 @@ public function readAndImport(): void
/** @var RedisConsumer $consumer */
$consumer = $this->redisContext->createConsumer($this->queue);

$dataTimestampArray = [];

/** @var RedisMessage $message */
while ($message = $consumer->receive()) {
$dataArrayToImport = (array) json_decode($message->getBody());
$dataTimestamp = strtotime($message->getHeader('recordedOn'));

if (array_key_exists($dataArrayToImport['Id'], $dataTimestampArray)) {
if ($dataTimestampArray[$dataArrayToImport['Id']] >= $dataTimestamp) {
++$this->messagesSkippedCount;

continue;
}
}

$dataTimestampArray[$dataArrayToImport['Id']] = $dataTimestamp;
$this->service->importSingleDataArrayWithoutResult($dataArrayToImport);
++$this->messagesImportedCount;
}
Expand Down

0 comments on commit 177b996

Please sign in to comment.