protonemedia /
laravel-api-health
| 1 | <?php |
||
| 2 | |||
| 3 | namespace ProtoneMedia\ApiHealth\Jobs; |
||
| 4 | |||
| 5 | use Illuminate\Bus\Queueable; |
||
| 6 | use Illuminate\Contracts\Queue\ShouldQueue; |
||
| 7 | use Illuminate\Foundation\Bus\Dispatchable; |
||
| 8 | use Illuminate\Queue\InteractsWithQueue; |
||
| 9 | use Illuminate\Queue\SerializesModels; |
||
| 10 | use ProtoneMedia\ApiHealth\Checkers\Checker; |
||
| 11 | use ProtoneMedia\ApiHealth\Checkers\Executor; |
||
| 12 | use ProtoneMedia\ApiHealth\Storage\CheckerState; |
||
| 13 | |||
| 14 | class RetryChecker implements ShouldQueue |
||
| 15 | { |
||
| 16 | use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 17 | |||
| 18 | public $checker; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Create a new job instance. |
||
| 22 | * |
||
| 23 | * @return void |
||
| 24 | */ |
||
| 25 | public function __construct(Checker $checker) |
||
| 26 | { |
||
| 27 | $this->checker = $checker; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Execute the job. |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | */ |
||
| 35 | public function handle() |
||
| 36 | { |
||
| 37 | (new CheckerState($this->checker))->addRetryTimestamp(); |
||
| 38 | |||
| 39 | (new Executor($this->checker))->handle(); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |