From 3788226ee9332945e90066b58f2b85026c2a0460 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期二, 18 五月 2021 10:56:32 +0800
Subject: [PATCH] change node init, no shm lock any more.

---
 box/center_main.cc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/box/center_main.cc b/box/center_main.cc
index a8d5b75..5eb21b9 100644
--- a/box/center_main.cc
+++ b/box/center_main.cc
@@ -92,7 +92,7 @@
 		return 0;
 	}
 
-	ns_log::AddLog("/tmp/bhshmq_center.log", true, true);
+	ns_log::AddLog("/tmp/bhshmq_center.log");
 	auto lvl = args.Get("log", "info");
 	if (strcasecmp(lvl.c_str(), "trace") == 0) { ns_log::ResetLogLevel(ns_log::LogLevel::trace); }
 	if (strcasecmp(lvl.c_str(), "debug") == 0) { ns_log::ResetLogLevel(ns_log::LogLevel::debug); }
@@ -102,6 +102,10 @@
 	if (strcasecmp(lvl.c_str(), "fatal") == 0) { ns_log::ResetLogLevel(ns_log::LogLevel::fatal); }
 
 	auto &shm = BHomeShm();
+	if (!CenterInit(shm)) {
+		LOG_FATAL() << "init memory error.";
+		exit(0);
+	}
 	GlobalInit(shm);
 
 	InstanceFlag inst(shm, kCenterRunningFlag);

--
Gitblit v1.8.0