Laravel waiting for queued job to finish

Viewed 261

I have a code where I dispatch events in my controller login method. This event is caught by the listener handle method which handles it with should queue interface and dispatches a job (using database driver) that is handled by the supervisor package. The job caches the products list, but if the user gets before this job finishes executing I would like to wait with the products response for a job to finish caching. This is how it looks

The question I have is how I check if the queued job is still running? As far as I know, I cannot dispatch additional events (like queuing finished), because I might have multiple jobs running in the backround and cannot listen to events in the controller? What should I use to have a check where I would know the job dispatched is finished. I cannot validate it by checking if the cache is present because at login I want to download the newest version always.

0 Answers
Related