This commit is contained in:
aozhiwei 2020-05-22 16:11:24 +08:00
parent 8329259ad1
commit 15ab670d4a

View File

@ -5,6 +5,7 @@
#include <a8/udplog.h> #include <a8/udplog.h>
#include <a8/mysql.h> #include <a8/mysql.h>
#include <a8/openssl.h> #include <a8/openssl.h>
#include <a8/strutils.h>
#include <google/protobuf/message.h> #include <google/protobuf/message.h>
@ -351,13 +352,14 @@ namespace f8
bool IsOnlineEnv() bool IsOnlineEnv()
{ {
return !getenv("SERVER_ENV"); static bool is_online = !getenv("SERVER_ENV");
return is_online;
} }
bool IsTestEnv() bool IsTestEnv()
{ {
char* env = getenv("SERVER_ENV"); static bool is_test = a8::SafeStrCmp(getenv("SERVER_ENV"), "TEST") == 0;
return std::string(env) == "TEST"; return is_test;
} }
bool IsValidNormalConfig(a8::XObject& conf, std::vector<std::string> fields) bool IsValidNormalConfig(a8::XObject& conf, std::vector<std::string> fields)