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();
|
KillGroup();
|
||||||
}
|
}
|
||||||
WaitAll();
|
WaitAll();
|
||||||
|
INFOF("(srvr) shutdown complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
// this function coroutines with linenoise
|
// this function coroutines with linenoise
|
||||||
|
@ -7371,15 +7372,6 @@ void RedBean(int argc, char *argv[]) {
|
||||||
ReplEventLoop();
|
ReplEventLoop();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!isexitingworker) {
|
|
||||||
HandleShutdown();
|
|
||||||
CallSimpleHookIfDefined("OnServerStop");
|
|
||||||
}
|
|
||||||
if (!IsTiny()) {
|
|
||||||
LuaDestroy();
|
|
||||||
TlsDestroy();
|
|
||||||
MemDestroy();
|
|
||||||
}
|
|
||||||
if (!isexitingworker) {
|
if (!isexitingworker) {
|
||||||
if (!IsTiny()) {
|
if (!IsTiny()) {
|
||||||
terminatemonitor = true;
|
terminatemonitor = true;
|
||||||
|
@ -7388,9 +7380,13 @@ void RedBean(int argc, char *argv[]) {
|
||||||
#ifndef STATIC
|
#ifndef STATIC
|
||||||
_join(&replth);
|
_join(&replth);
|
||||||
#endif
|
#endif
|
||||||
|
HandleShutdown();
|
||||||
|
CallSimpleHookIfDefined("OnServerStop");
|
||||||
}
|
}
|
||||||
if (!isexitingworker) {
|
if (!IsTiny()) {
|
||||||
INFOF("(srvr) shutdown complete");
|
LuaDestroy();
|
||||||
|
TlsDestroy();
|
||||||
|
MemDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue