Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
笃敏 committed Dec 11, 2023
1 parent e5c8af9 commit 456f718
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/aggregator/Aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ bool Aggregator::Add(const std::string& projectName,

LogstoreFeedBackKey feedBackKey
= config == NULL ? GenerateLogstoreFeedBackKey(projectName, category) : config->GetLogstoreKey();
int64_t key, logstoreKey;
int64_t key, logstoreKey = 0;
if (mergeType == FlusherSLS::Batch::MergeType::LOGSTORE) {
logstoreKey = HashString(projectName + "_" + category);
key = logstoreKey;
Expand Down
16 changes: 12 additions & 4 deletions core/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ bool Config::Parse() {
#ifdef __ENTERPRISE__
// to send alarm, project, logstore and region should be extracted first.
key = "flushers";
const Json::Value* it = mDetail->find(key.c_str(), key.c_str() + key.size());
itr = mDetail->find(key.c_str(), key.c_str() + key.size());
if (itr && itr->isArray()) {
for (Json::Value::ArrayIndex i = 0; i < itr->size(); ++i) {
const Json::Value& plugin = (*itr)[i];
Expand Down Expand Up @@ -254,7 +254,8 @@ bool Config::Parse() {
#ifdef __ENTERPRISE__
} else if (pluginName == "input_stream") {
if (!AppConfig::GetInstance()->GetOpenStreamLog()) {
PARAM_ERROR_RETURN(sLogger, "stream log is not enabled", noModule, mName, mProject, mLogstore, mRegion);
PARAM_ERROR_RETURN(
sLogger, alarm, "stream log is not enabled", noModule, mName, mProject, mLogstore, mRegion);
}
hasStreamInput = true;
#endif
Expand All @@ -276,8 +277,14 @@ bool Config::Parse() {
}
#ifdef __ENTERPRISE__
if (hasStreamInput && !itr->empty()) {
PARAM_ERROR_RETURN(
sLogger, "processor plugins coexist with input_stream", noModule, mName, mProject, mLogstore, mRegion);
PARAM_ERROR_RETURN(sLogger,
alarm,
"processor plugins coexist with input_stream",
noModule,
mName,
mProject,
mLogstore,
mRegion);
}
#endif
bool isCurrentPluginNative = true;
Expand Down Expand Up @@ -473,6 +480,7 @@ bool Config::Parse() {
#ifdef __ENTERPRISE__
if (hasStreamInput && pluginName != "flusher_sls") {
PARAM_ERROR_RETURN(sLogger,
alarm,
"flusher plugins other than flusher_sls coexist with input_stream",
noModule,
mName,
Expand Down

0 comments on commit 456f718

Please sign in to comment.