bug(server): exit not crash when port in use (#516)

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2022-11-29 10:42:57 +02:00 committed by GitHub
parent 2493434b23
commit f57bf0dfe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

2
helio

@ -1 +1 @@
Subproject commit 3ad1137f0541381c73a44a3430ea38c7af7796bd
Subproject commit 8d0f0cc37908623705125128d3c64d35d410fb0f

View file

@ -186,7 +186,10 @@ bool RunEngine(ProactorPool* pool, AcceptServer* acceptor) {
error_code ec = acceptor->AddListener(bind_addr, port, main_listener);
LOG_IF(FATAL, ec) << "Could not open port " << port << ", error: " << ec.message();
if (ec) {
LOG(ERROR) << "Could not open port " << port << ", error: " << ec.message();
exit(1);
}
if (mc_port > 0) {
acceptor->AddListener(mc_port, new Listener{Protocol::MEMCACHE, &service});