diff options
Diffstat (limited to 'common/src/tfe_resource.cpp')
| -rw-r--r-- | common/src/tfe_resource.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/common/src/tfe_resource.cpp b/common/src/tfe_resource.cpp index 54c35a1..356827e 100644 --- a/common/src/tfe_resource.cpp +++ b/common/src/tfe_resource.cpp @@ -60,57 +60,57 @@ static struct maat *create_maat_feather(const char *instance_name, const char *p maat_options_set_caller_thread_number(opts, max_thread); switch (input_mode) { - case MAAT_INPUT_JSON: - if (!strlen(json_cfg_file)) - { - TFE_LOG_ERROR(logger, "Invalid json_cfg_file, MAAT init failed."); - goto error_out; - } - maat_options_set_json_file(opts, json_cfg_file); - break; - case MAAT_INPUT_REDIS: - if (!strlen(redis_server)) - { - TFE_LOG_ERROR(logger, "Invalid maat_redis_server, MAAT init failed."); - goto error_out; - } - - ret = sscanf(redis_port_range, "%d-%d", &redis_port_begin, &redis_port_end); - if (ret == 1) - { - redis_port_select = redis_port_begin; - } - else if (ret == 2) - { - srand(time(NULL)); - redis_port_select = redis_port_begin + rand() % (redis_port_end - redis_port_begin); - } - else - { - TFE_LOG_ERROR(logger, "Invalid redis port range %s, MAAT init failed.", redis_port_range); - - goto error_out; - } - maat_options_set_redis(opts, redis_server, redis_port_select, redis_db_idx); - break; - case MAAT_INPUT_FILE: - if (!strlen(ful_cfg_dir)) - { - TFE_LOG_ERROR(logger, "Invalid ful_cfg_dir, MAAT init failed."); - goto error_out; - } - - if (!strlen(inc_cfg_dir)) - { - TFE_LOG_ERROR(logger, "Invalid inc_cfg_dir, MAAT init failed."); - goto error_out; - } - maat_options_set_iris(opts, ful_cfg_dir, inc_cfg_dir); - break; - default: - TFE_LOG_ERROR(logger, "Invalid MAAT Input Mode: %d.", input_mode); - goto error_out; - break; + case MAAT_INPUT_JSON: + if (!strlen(json_cfg_file)) + { + TFE_LOG_ERROR(logger, "Invalid json_cfg_file, MAAT init failed."); + goto error_out; + } + maat_options_set_json_file(opts, json_cfg_file); + break; + case MAAT_INPUT_REDIS: + if (!strlen(redis_server)) + { + TFE_LOG_ERROR(logger, "Invalid maat_redis_server, MAAT init failed."); + goto error_out; + } + + ret = sscanf(redis_port_range, "%d-%d", &redis_port_begin, &redis_port_end); + if (ret == 1) + { + redis_port_select = redis_port_begin; + } + else if (ret == 2) + { + srand(time(NULL)); + redis_port_select = redis_port_begin + rand() % (redis_port_end - redis_port_begin); + } + else + { + TFE_LOG_ERROR(logger, "Invalid redis port range %s, MAAT init failed.", redis_port_range); + + goto error_out; + } + maat_options_set_redis(opts, redis_server, redis_port_select, redis_db_idx); + break; + case MAAT_INPUT_FILE: + if (!strlen(ful_cfg_dir)) + { + TFE_LOG_ERROR(logger, "Invalid ful_cfg_dir, MAAT init failed."); + goto error_out; + } + + if (!strlen(inc_cfg_dir)) + { + TFE_LOG_ERROR(logger, "Invalid inc_cfg_dir, MAAT init failed."); + goto error_out; + } + maat_options_set_iris(opts, ful_cfg_dir, inc_cfg_dir); + break; + default: + TFE_LOG_ERROR(logger, "Invalid MAAT Input Mode: %d.", input_mode); + goto error_out; + break; } maat_options_set_foreign_cont_dir(opts, "./pangu_files"); if (maat_stat_on) |
