R
R
RacceGatel2021-08-26 08:11:03
Laravel
RacceGatel, 2021-08-26 08:11:03

Can I check if the current task is running in the queue(database)?

I have some Job which in the handle dispatches a new instance of itself with a certain delay. Can I somehow check before the very first dispatch whether this task is already in the queue?

I need all this to loop a job that will work after a certain period of time. And at some point it will be necessary to interrupt this cycle, and also check whether this job is running at all.

Laravel 8

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
RacceGatel, 2021-08-26
@RacceGatel

In general, I did everything through Atomic Lock. I created the keys, and inside the job I looked whether the key was locked. Further, everything worked with a bang

R
Ruslan Saifullin, 2021-08-26
@Shapito27

Looks like WithoutOverlapping()it should help

N
NubasLol, 2021-08-26
@NubasLol

Documentation is no longer fashionable to read?
https://laravel.com/docs/8.x/queues#unique-jobs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question