Skip to content

Commit

Permalink
Merge pull request #94 from keboola/ondra-fix-counter
Browse files Browse the repository at this point in the history
fix properties row counter
  • Loading branch information
ondrajodas authored Jun 27, 2022
2 parents 10c6585 + a6ec829 commit 3b60928
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Extractor/Paginator/PropertiesPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ public function setProperty(array $property): self

public function paginate(array $query, array $report, CsvFile $csvFile): void
{
$localCounter = 0;
do {
$localCounter += $report['rowCount'];
$this->rowCounter += $report['rowCount'];

// writer first result
$propertyId = str_replace('properties/', '', $this->property['propertyKey']);
$this->output->writeReport($csvFile, $report, $propertyId);

$this->logger->info(sprintf('Downloaded %s/%s records.', $this->rowCounter, $report['totals']));
$this->logger->info(sprintf('Downloaded %s/%s records.', $localCounter, $report['totals']));

// get next page if there's any
$nextQuery = null;
Expand Down

0 comments on commit 3b60928

Please sign in to comment.