If you’re using AWS Fargate and need to pause your containers so you can gracefully deploy a new version, you could use the StopTask command. However it has a timeout value that you have to worry about before it sends a SIGKILL which might stop a job midway causing unpredictable results.

Rather than worry about this, I looked into a way to gracefully pause the worker but the previous solutions I came across assumed SSH access to the worker was available, which is not an option in Fargate world.

Looking through the Laravel Worker.php sourcecode, I came across an undocumented…

Alex Bergin

Software Developer in Perth, Western Australia

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store