mardi 26 novembre 2019

How to test that a job is released after a certain time when failing?

When I have a job like this

class CheckVideoStatusJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public $video;

    public function __construct(Video $video)
    {
        $this->video = $video;
    }

    public function handle(CheckStatusAction $action)
    {
        if (! $action->execute($this->video)) {
            $this->release(60);
        }
    }
}

How can I test: when the job has failed it will be released back to the queue after (60) seconds?

Aucun commentaire:

Enregistrer un commentaire