May 20, 2021
0
Level 17
Nova Queued Actions
I create queued action in resource with almost empty handlemethod
<?php
namespace App\Nova\Actions;
use App\Jobs\ExportExcelJob;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Collection;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\ActionFields;
class ExportExternalApplicantAction extends Action implements ShouldQueue
{
use InteractsWithQueue, Queueable;
public $name = 'Export excel';
/**
* Perform the action on the given models.
*
* @param \Laravel\Nova\Fields\ActionFields $fields
* @param \Illuminate\Support\Collection $models
* @return mixed
*/
public function handle(ActionFields $fields, Collection $models)
{
// ExportExcelJob::dispatch($models);
return Action::message(__('Export started! Check your email'));
}
/**
* Get the fields available on the action.
*
* @return array
*/
public function fields()
{
return [];
}
}
If I selecting all items in page and run the action, it instantly shows message and goes to queue. Problem appears then I select all records in resource (9000) then action creates 3 actions every couple seconds in queue and after 30 seconds code timeouts (Maximun execution time of 30 seconds exceeded ). Where is the problem? Why it not working in the background? https://ibb.co/7GFJRbk
Please or to participate in this conversation.