0

I have a log inside one of Laravel Jobs that I've already removed a few days ago. Today I checked and the log is still showing even though it's no longer in the code. I checked manually and it is indeed gone from the server file. So I'm wondering why this is happening and does this mean every time I do an update I have to do the ff:

php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear

Is Laravel doing this or could be a server cache?

If it is server cache where can I find the config for it?

We're using Ubuntu 20.04.5 LTS and nginx

PHP v8.0

Laravel v9.37.0

magicianiam
  • 1,474
  • 7
  • 33
  • 70
  • 1
    *" I checked manually and it is indeed gone from the server file."* - curious question, is the process that runs `artisan queue:work` restarted? I believe one of those `clear` calls actually tell the running queue worker that "something changed" so it reloads stuff. – Bagus Tesa Nov 07 '22 at 12:28
  • we're using supervisor for our queue. Does that mean if a job code has been updated you need to restart the queue? – magicianiam Nov 07 '22 at 12:35
  • if the `php` instance that runs the queue still running, it might be unaware of the new code for it already loaded most of the relevant `php` files into memory. as far as I can remember `artisan queue:work` do spawn a persistent `php` process that wont go away unless being told to. – Bagus Tesa Nov 07 '22 at 12:41
  • oh okay. thanks. i'll give that a try by restarting supervisor and see if it still pick the old job code. – magicianiam Nov 07 '22 at 12:43
  • 4
    You have to restart the queue after each code change in your Laravel application: `php artisan queue:restart` or `php artisan horizon:terminate` if your using horizon. https://stackoverflow.com/a/52935241/9193055 – Remul Nov 07 '22 at 13:34
  • aye, i didn't know it does. guess I have to add it to the list of things I have to do after an update – magicianiam Nov 07 '22 at 14:04

0 Answers0