Livekit team, is there official documentation on on_shutdown anywhere? Kind of confusing, as it’s an async function, but it seems like I can’t trust it to execute all my code. I have 3 async functions within on_shutdown, one makes a db call, another makes an llm chat completion call (standalone), and then one more fast db insert call.
should all execute in <5s
How should I think about on_shutdown vs on_exit?
Seems like the only way I can trust it is by moving all code to an api endpoint and then doing a fire-and-forget in on_shutdown. What about dirty stops, as in, client’s computer powers off mid-session?