Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jack100's avatar

Queue Job - execution of old code

I am using Jobs in Laravel with Redis to schedule executions. It works well with my old jobs.

I have implemented a new one now, which throws an error on one line of code since the reference is not found. I commented out this line from the code base, but the error is still thrown on the commented line. ????

I cleared Laravel cache: php artisan dumpautoload

I restartetd supervisor.

The changed file is also on the server. I checked the files directly.

Still the same error. From where comes this old version of the Job?

0 likes
7 replies
goatshark's avatar

@jack100 Are you running Horizon? Or are you just running some php artisan queue:work commands from cron?

Have you tried to php artisan queue:flush and php artisan queue:restart?

1 like
jack100's avatar

I am using supervisor for the queue worker to be executed.

I restarted supervisor service to pull latest code changes.

The error is the same.

goatshark's avatar

Restarting supervisor is nice and I believe it results in the same outcome as php artisan queue:restart, but did you try php artisan queue:flush?

jack100's avatar

I flushed the queue now. The failed table is empty. The result is the same. The error is still the same. Old code is executed, which is commented out.

goatshark's avatar

@jack100 Well that's frustrating AF. I know I've run into this before. I'll look through a few projects to see if I can find anything helpful.

jack100's avatar
jack100
OP
Best Answer
Level 1

For me it worked to run:

composer dumpautoload -o

This seems to update the outdated code fragments.

1 like

Please or to participate in this conversation.