Improve shutdown process
This commit is contained in:
parent
fa64636948
commit
793667af1c
1 changed files with 2 additions and 0 deletions
|
@ -481,6 +481,8 @@ void StopHTTPServer()
|
||||||
}
|
}
|
||||||
if (eventBase) {
|
if (eventBase) {
|
||||||
LogPrint(BCLog::HTTP, "Waiting for HTTP event thread to exit\n");
|
LogPrint(BCLog::HTTP, "Waiting for HTTP event thread to exit\n");
|
||||||
|
// Exit the event loop as soon as there are no active events.
|
||||||
|
event_base_loopexit(eventBase, nullptr);
|
||||||
// Give event loop a few seconds to exit (to send back last RPC responses), then break it
|
// Give event loop a few seconds to exit (to send back last RPC responses), then break it
|
||||||
// Before this was solved with event_base_loopexit, but that didn't work as expected in
|
// Before this was solved with event_base_loopexit, but that didn't work as expected in
|
||||||
// at least libevent 2.0.21 and always introduced a delay. In libevent
|
// at least libevent 2.0.21 and always introduced a delay. In libevent
|
||||||
|
|
Loading…
Reference in a new issue