Skip to content

Commit

Permalink
Use configured chunk size and queue in ExportProcessor (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
myraoliveros-cp authored Jul 25, 2024
1 parent ec11da5 commit 04607b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Export/Jobs/ExportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function formatRow($row): array
public function handle(): void
{
$jobs = [];
$perPage = 500; // Number of items per page
$perPage = static::chunkSize(); // Number of items per page
$totalRecords = $this->query()->count();
$totalPages = ceil($totalRecords / $perPage);
$batchUuid = Str::uuid();
Expand Down Expand Up @@ -83,9 +83,15 @@ public function handle(): void
})
->allowFailures()
->name($this->name())
->onQueue(config('nova-data-sync.exports.queue', 'default'))
->dispatch();
}

public static function chunkSize(): int
{
return config('nova-data-sync.exports.chunk_size', 1000);
}

protected function name(): string
{
if (empty($this->name)) {
Expand Down

0 comments on commit 04607b7

Please sign in to comment.