<?php
namespace App\Jobs;
use App\Models\ChainTransaction;use Illuminate\Bus\Queueable;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Foundation\Bus\Dispatchable;use Illuminate\Queue\InteractsWithQueue;use Illuminate\Queue\SerializesModels;
final class RefreshStuckConfirmingTransactionsJob implements ShouldQueue {use Dispatchable,InteractsWithQueue,Queueable,SerializesModels;public function __construct(){$this->onQueue('confirmations');}public function handle():void{ChainTransaction::whereNotIn('finality_status',['confirmed','failed'])->where('updated_at','<=',now()->subSeconds(10))->chunkById(100,fn($rows)=>$rows->each(fn($tx)=>RefreshTransactionFinalityJob::dispatch($tx->id)->onQueue('confirmations')));}}
