Updating a worker that might still be working

I have a worker Fly app that doesn’t accept HTTP requests. It’s simply subscribed to Postgres and starts working based on some triggers on a Jobs table.

I imagine in apps with HTTP Fly will check if there are any pending requests before shutting down the VM while doing an update.

So how does this work with workers apps?

I imagine, after receiving SIGTERM I could wait to actually kill the Node app with process.exit() until the current job has finished. But what if this takes a minute or more? Will this bother Fly in some way?

Catching SIGINT is the correct way to handle this. We have settings for it!

This is not always perfect, if we have a hardware failure you can’t count on that working. But for normal deploys, you’re good.

1 Like

Thanks @kurt !

A live video streaming service may a have users (often teenagers) connected for hours at a time.

@michael your blogging style is on point :joy: