Replies: 1 comment
-
@JekaSylar probably something is failing, first thing first you need to make sure there isn't a limit on max tries on your job. Take a look at the failed_jobs table, there is a "exception" column with reason details. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Good afternoon, I found your library and decided to try it. I need to solve such a problem, I receive data from a third-party server and there is a limit of 30 API requests per minute, that is, I need to make sure that after 30 requests there is a break in minutes. Here is the code
`<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Service\TGStat;
use Spatie\RateLimitedMiddleware\RateLimited;
class LoadStatJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $channelId;
/**
*/
public function __construct($channelId)
{
$this->channelId = $channelId;
}
/**
Execute the job.
@return void
*/
public function handle()
{
// Выполнение задачи
$tgStat = new TGStat($this->channelId);
$tgStat->loadStatic();
}
public function middleware()
{
$rateLimitedMiddleware = (new RateLimited())
->allow(30)
->everySeconds(60)
->releaseAfterSeconds(90);
}
}`
Why is there such an error https://i.imgur.com/r7YKCri.jpeg
I use Laravel 9.52
help me please
Beta Was this translation helpful? Give feedback.
All reactions