0
我有一个队列向我的用户端点运行一些回调请求。laravel queue(重试作业5次)并将作业标记为失败“手动”
下面是我的队列的代码。
public function handle()
{
//send webrequest here....
//check the response of user backend
if ($res->getStatusCode() != 200 || $res->getBody()->getContents() != "*received*")
throw new Exception('callback url not reachable');
}
public function failed(Exception $exception)
{
//check tries and try again if needed
//check if job failed for 5 times
//if not ->retry again in 5 minutes, increment the times tried
//if yes ->disable API access, send email
Log::info("user email send, callback disabled!");
}
如何让工作失败(我当前的异常使整个作业结束),当WebRequest的答案!=“收到”,并检查某些作业失败5次? 如果工作失败,应在5分钟内再次尝试。
我不明白关于这些观点的文档。