Tell me about the shutdown_process_timeout paramet...
# ask-ai
w
Tell me about the shutdown_process_timeout parameter for WorkerOptions and what does it do?
t
Thanks for reaching out, Arthur. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just wanted to explain a bit about the
shutdown_process_timeout
parameter in
WorkerOptions
. It basically sets how long the LiveKit Agents framework will wait for a job to shut down nicely before it has to step in and forcefully stop the process. This timeout is all about those shutdown hooks you add with
ctx.add_shutdown_callback()
, which take care of important cleanup and post-processing when a job finishes. If those hooks don’t finish up in time, the process will be ended automatically. By default, this timeout is 60 seconds (or 60,000 milliseconds if you’re using the JavaScript SDK), but you can totally adjust it when you create a
WorkerOptions
instance if you need more time for longer cleanup tasks. Sources: livekit-agents/livekit/agents/cli/cli.py | Inside a session | LiveKit Docs | Inside a session | LiveKit Docs | Inside a session | LiveKit Docs | Anatomy of an Agent | LiveKit Docs