-
Hello, I've deployed a procrastinate worker in prod using a systemd unit. It works fine. However I'd like to know if there's a way for me to reload the worker so it picks any changes to the tasks, for exampe be sending it a unix signal. Right now I can restart it by restarting the systemd unix but I'd prefer a better solution. For example, we can sent it a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Can you spare a few words on why this is not a good solution to you? What problem are you trying to solve? |
Beta Was this translation helpful? Give feedback.
SIGHUP in Gunicorn may reload the config but only reloads the python modules in certain cases (when
preload_app
is not active). This is because the main process in Gunicorn (to my knowledge) is not the one that answers requests. Upon SIGHUP, it may stop the worker process(es) and start a new one.Procrastinate (currently) runs everything in its own process, so if we want to restart, we can't stop a subprocess and start a new one: there's no subprocess to restart.
Reloading a Python module in place may be a bit complex, especially around the fact that old objects continue existing while new ones are added. In other works, if you use
importlib.reload
on a module that has a class following t…