Prevent conf updates or restarts to "busy" containers

I have a number of containers that run long processes in the swarm. These processes should never be interrupted. Is there a way to prevent the container from being triggered to restart by any outside service (I use swarmpit) or command line actions?

This is how my setup works. I have this “worker” that processes queued jobs. When it’s free it should be allowed to restart, when it’s running a job, I want to prevent it from restarting and continue on until it’s done.

The challenge is preventing the program from being stopped and preventing the container from shutting down without causing more issues and orphaned instances.

Anyone run into a similar issue?

Yep, we have this issue was well. We want the “worker” to finish its jobs before the swarm scales down in order to prevent orphans.