You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new LoadImportBatch,
])->then(function (Batch $batch) {
// All jobs completed successfully...
})->name('Import Contacts')->dispatch();
the the loadImportBatch hydrates the batch like this
use App\Jobs\ImportContacts;
use Illuminate\Support\Collection;
/**
* Execute the job.
*/
public function handle(): void
{
if ($this->batch()->cancelled()) {
return;
}
$this->batch()->add(Collection::times(1000, function () {
return new ImportContacts;
}));
}
but the "importContacts" job gets dispatched and the LoadImportBatch doesn't finish untile all the importContact jobs are done. When there to many, it wil eventually fail.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
i use the batch hydrating strategy described here
https://laravel.com/docs/10.x/queues#inspecting-batches
first layer is
the the loadImportBatch hydrates the batch like this
but the "importContacts" job gets dispatched and the LoadImportBatch doesn't finish untile all the importContact jobs are done. When there to many, it wil eventually fail.
Beta Was this translation helpful? Give feedback.
All reactions