SIGUSR1 #2629
SIGUSR1
#2629
-
I would like to define a custom How to do this? Currently it looks like when doing By reading the implementation, it looks like I can do import uvicorn
def handle_usr1(*args):
... # update stuff
setattr(
uvicorn.supervisors.multiprocess.Multiprocess,
'handle_usr1',
handle_usr1
) Now, I would like to do the updating as a background task. I still need to figure out how to do this. |
Beta Was this translation helpful? Give feedback.
Answered by
franklinvp
May 9, 2025
Replies: 1 comment
-
OK. I think I figured it out.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
franklinvp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK. I think I figured it out.
handle_usr1
touvicorn.supervisors.multiprocess.Multiprocess
. This is written to set a method thus called as the handler of the SIGUSR1 signal. Make the method runsignal.siginterrupt(signal.SIGUSR1, False)
and then send SIGUSR1 to each of itsself.processes
.uvicorn.server.Server.startup
to include a lineself.config.loaded_app.app.state
or somewhere known to the app.