Dispatch job:
for ($i=0;$i<2500;$i++) {
MyTestJob::dispatch($i);
}
Job class:
class MyTestJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $tries = 1;
protected $i;
public function __construct( $i)
{
$this->i = $i;
}
public function handle(OrderInProcessRepository $orderInProcessRepository)
{
return true;
}
}
I have a queue job which needs to be dispatched many times within a very short time, but when I try to run the queue worker, for some jobs it works, and for others it fails:
Has been attempted too many times or run too long. The job may have previously timed out.
Is there any way to fix this, or it will happen if I call the same job many times within a short period of time?