From 9bc87246f3eb7f0db765bb838129c2ca2fda0056 Mon Sep 17 00:00:00 2001 From: groot Date: Tue, 29 Oct 2019 15:37:08 +0800 Subject: [PATCH] format code Former-commit-id: 8c41e145da1afd1f770bc1b8012b300368b6e95a --- core/src/server/DBWrapper.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/src/server/DBWrapper.cpp b/core/src/server/DBWrapper.cpp index 7efb7107..e3d319ac 100644 --- a/core/src/server/DBWrapper.cpp +++ b/core/src/server/DBWrapper.cpp @@ -40,12 +40,14 @@ DBWrapper::StartService() { engine::DBOptions opt; s = config.GetDBConfigBackendUrl(opt.meta_.backend_uri_); if (!s.ok()) { + std::cerr << s.ToString() << std::endl; return s; } std::string path; s = config.GetDBConfigPrimaryPath(path); if (!s.ok()) { + std::cerr << s.ToString() << std::endl; return s; } @@ -55,7 +57,7 @@ DBWrapper::StartService() { s = config.GetDBConfigSecondaryPath(db_slave_path); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } StringHelpFunctions::SplitStringByDelimeter(db_slave_path, ";", opt.meta_.slave_paths_); @@ -64,14 +66,14 @@ DBWrapper::StartService() { s = config.GetCacheConfigCacheInsertData(opt.insert_cache_immediately_); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } std::string mode; s = config.GetServerConfigDeployMode(mode); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } if (mode == "single") { @@ -91,7 +93,7 @@ DBWrapper::StartService() { s = config.GetEngineConfigOmpThreadNum(omp_thread); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } if (omp_thread > 0) { @@ -110,7 +112,7 @@ DBWrapper::StartService() { s = config.GetEngineConfigUseBlasThreshold(use_blas_threshold); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } faiss::distance_compute_blas_threshold = use_blas_threshold; @@ -121,7 +123,7 @@ DBWrapper::StartService() { s = config.GetDBConfigArchiveDiskThreshold(disk); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } if (disk > 0) { @@ -131,7 +133,7 @@ DBWrapper::StartService() { s = config.GetDBConfigArchiveDaysThreshold(days); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } if (days > 0) { @@ -174,7 +176,7 @@ DBWrapper::StartService() { s = config.GetDBConfigPreloadTable(preload_tables); if (!s.ok()) { std::cerr << s.ToString() << std::endl; - kill(0, SIGUSR1); + return s; } s = PreloadTables(preload_tables); -- GitLab