mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 11:20:30 +00:00
Update redbean shutdown to call OnServerStop when all shutdown/logging is done
This commit is contained in:
parent
ffedbfe14d
commit
fa4174a0ad
1 changed files with 7 additions and 11 deletions
|
@ -7058,6 +7058,7 @@ static void HandleShutdown(void) {
|
|||
KillGroup();
|
||||
}
|
||||
WaitAll();
|
||||
INFOF("(srvr) shutdown complete");
|
||||
}
|
||||
|
||||
// this function coroutines with linenoise
|
||||
|
@ -7371,15 +7372,6 @@ void RedBean(int argc, char *argv[]) {
|
|||
ReplEventLoop();
|
||||
}
|
||||
#endif
|
||||
if (!isexitingworker) {
|
||||
HandleShutdown();
|
||||
CallSimpleHookIfDefined("OnServerStop");
|
||||
}
|
||||
if (!IsTiny()) {
|
||||
LuaDestroy();
|
||||
TlsDestroy();
|
||||
MemDestroy();
|
||||
}
|
||||
if (!isexitingworker) {
|
||||
if (!IsTiny()) {
|
||||
terminatemonitor = true;
|
||||
|
@ -7388,9 +7380,13 @@ void RedBean(int argc, char *argv[]) {
|
|||
#ifndef STATIC
|
||||
_join(&replth);
|
||||
#endif
|
||||
HandleShutdown();
|
||||
CallSimpleHookIfDefined("OnServerStop");
|
||||
}
|
||||
if (!isexitingworker) {
|
||||
INFOF("(srvr) shutdown complete");
|
||||
if (!IsTiny()) {
|
||||
LuaDestroy();
|
||||
TlsDestroy();
|
||||
MemDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue