Understanding the Behaviour of Queue Workers when Restarted on Deployment in App Platform

I’m setting up a worker in an App Platform app which is hosting a Laravel app. The worker container is going to be running php artisan queue:work as its foreground process.

My question is: What would happen to the queue worker container when the app is deployed and all the containers are restarted? Would the worker container also be restarted? If so, is there a way to cause the deployment to wait for the worker to finish processing the queue and exit gracefully?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

[Adding this after some time without an answer.]

Sorry if my question was a little vague, perhaps if we remove the artisan part; what I’m really trying to understand is the nature of the restarting of worker containers when an app is deployed on App Platform.

So my revised question is:

When a deployment takes place on an App Platform app, if the build succeeds and the deployment is successful, what happens to the existing worker containers? Are they shut down and replaced with new containers?

If so, are the worker containers shut down gracefully? What I mean by that is, are they given a chance to finish processing current tasks, or is the plug simply pulled?