提交 51d9e2c2 编写于 作者: J jinhai

Add license check functions


Former-commit-id: d3120c7b805a59bcb736908990d68652008eca8d
上级 56ffd6ba
......@@ -11,6 +11,10 @@ aux_source_directory(utils utils_files)
aux_source_directory(db db_files)
aux_source_directory(wrapper wrapper_files)
set(license_check_files
${CMAKE_CURRENT_SOURCE_DIR}/license/License.cpp
)
set(service_files
thrift/gen-cpp/VecService.cpp
thrift/gen-cpp/VectorService_constants.cpp
......@@ -49,6 +53,7 @@ add_executable(vecwise_server
${server_files}
${utils_files}
${service_files}
${license_check_files}
${VECWISE_THIRD_PARTY_BUILD}/include/easylogging++.cc
)
......@@ -69,3 +74,8 @@ set(server_libs
)
target_link_libraries(vecwise_server ${server_libs})
set(license_generator_src
${CMAKE_CURRENT_SOURCE_DIR}/license/LicenseGenerator.cpp)
add_executable(license_generator ${license_generator_src})
#include "License.h"
namespace zilliz {
namespace vecwise {
namespace server {
ServerError
LicenseValidate(const std::string& path) {
return SERVER_SUCCESS;
}
}
}
}
\ No newline at end of file
#pragma once
#include "utils/Error.h"
namespace zilliz {
namespace vecwise {
namespace server {
ServerError
LicenseValidate(const std::string& path);
}
}
}
#include <iostream>
int main() {
std::cout << "This is license generator" << std::endl;
return 0;
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
#include "utils/Log.h"
#include "utils/SignalUtil.h"
#include "utils/TimeRecorder.h"
#include "license/License.h"
#include <fcntl.h>
#include <sys/stat.h>
......@@ -133,6 +133,12 @@ Server::Daemonize() {
int
Server::Start() {
std::string license_file_path = "/tmp/vecwise.license";
if(LicenseValidate(license_file_path) != SERVER_SUCCESS) {
SERVER_LOG_ERROR << "License check failed";
return 1;
}
if (daemonized_) {
Daemonize();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册