Skip to content

Commit

Permalink
Add ability to override exportprocessor query count
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbjr committed Aug 13, 2024
1 parent 04607b7 commit 008d274
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Export/Jobs/ExportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function handle(): void
{
$jobs = [];
$perPage = static::chunkSize(); // Number of items per page
$totalRecords = $this->query()->count();
$totalRecords = $this->getQueryCount();
$totalPages = ceil($totalRecords / $perPage);
$batchUuid = Str::uuid();
$exportName = $this->name();
Expand Down Expand Up @@ -91,7 +91,7 @@ public static function chunkSize(): int
{
return config('nova-data-sync.exports.chunk_size', 1000);
}

protected function name(): string
{
if (empty($this->name)) {
Expand Down Expand Up @@ -148,4 +148,9 @@ public function setDirectory(string $directory): self

return $this;
}

protected function getQueryCount(): int
{
return $this->query()->count();
}
}

0 comments on commit 008d274

Please sign in to comment.