droplister's avatar

Is there a cache for Jobs?

I've been writing some Job classes for my app.

I regularly run commands like migrate, composer dump-autoload, artisan cache:clear, after I make changes to commands or my database, but what I am noticing lately is that changes I make to Job classes are often not reflected after running these commands.

Is there some extra cache or static file that I need to touch when I make changes to Job classes so that those changes become instantly active?

For example, I have a Job class where I set a value equal to 1. And then I changed the Job so that this value is equal to 01. I have run composer dump-autoload, php artisan clear:cache, and rolled back and reseeded by databases, just for good measure, but still I see 1 vs 01 coming through. It's no longer in the code, so it must be cached somewhere?

0 likes
5 replies
berimbasket's avatar

restarted supervisord, and it worked. -.-

this solved:

 php artisan queue:listen

THIS NOT SOLVED:

 php artisan queue:restart
1 like
Snapey's avatar

@berimbasket 5 years ago......

php artisan queue:restart causes the jobs to gracefully terminate then supervisor will start them again.

2 likes
martyyy's avatar

Oh man, thank you, how is it possible to lose two days in debugging, clear all possible caches and just this command to fix the cached code which job execute!!!!

Thank you, you saved me another 2 days in debugging!

jigar_dhulla's avatar

For the ones who are using Laravel Horizon redis queue in containers. Restart the horizon container.

Please or to participate in this conversation.