Level 63
Not sure, I think that the rate limiter is applied for each job individually, I mean that if a job fails, it will be retried according to the rate limiter.
Can somebody confirm ?
Are you trying to execute the jobs by chunk ?
hello, i have setted up my rate limiter like this inside appServiceProvider.php
RateLimiter::for('invite', function ($job) {
return Limit::perMinutes(
decayMinutes: 10,
maxAttempts: 5
);
});
i have setted up my job like this
class SendInviteMailJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*/
public function __construct(
private invite $invite,
private Contact $contact,
) {
//
}
public function middleware()
{
return [
new RateLimited('invite'),
];
}
/**
* Execute the job.
*/
public function handle(): void
{
FacadesLog::info('Sending invite mail to: ' . $this->contact->email);
Mail::to($this->contact->email)->send($this->invite);
}
}
but when i do queue:work all the jobs (i queue 2k jobs) are runned together, without limiting the execution, what am i doing wrong? thanks
Please or to participate in this conversation.