修复bug:redis不可用时没有对redis context判空
This commit is contained in:
@@ -78,7 +78,7 @@ redisContext * connect_redis(const char*redis_ip, int redis_port, int redis_db,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
MESA_handle_runtime_log(logger, RLOG_LV_FATAL, maat_redis_monitor,
|
MESA_handle_runtime_log(logger, RLOG_LV_FATAL, maat_redis_monitor,
|
||||||
"Unable to connect redis server %s:%d db%d, error: %s\n",
|
"Unable to connect redis server %s:%d db%d, error: %s",
|
||||||
redis_ip, redis_port, redis_db, ctx==NULL ? "Unknown" : ctx->errstr);
|
redis_ip, redis_port, redis_db, ctx==NULL ? "Unknown" : ctx->errstr);
|
||||||
}
|
}
|
||||||
if(ctx!=NULL) redisFree(ctx);
|
if(ctx!=NULL) redisFree(ctx);
|
||||||
@@ -1767,6 +1767,10 @@ void redis_monitor_traverse(long long version, struct maat_redis_ctx* mr_
|
|||||||
}
|
}
|
||||||
MESA_handle_runtime_log(logger, RLOG_LV_INFO, maat_redis_monitor, "Reconnecting...");
|
MESA_handle_runtime_log(logger, RLOG_LV_INFO, maat_redis_monitor, "Reconnecting...");
|
||||||
mr_ctx->read_ctx=connect_redis(mr_ctx->redis_ip, mr_ctx->redis_port, mr_ctx->redis_db, feather->logger);
|
mr_ctx->read_ctx=connect_redis(mr_ctx->redis_ip, mr_ctx->redis_port, mr_ctx->redis_db, feather->logger);
|
||||||
|
if(mr_ctx->read_ctx==NULL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rule_num=get_rm_key_list(mr_ctx->read_ctx, version, feather->load_version_from, &new_version, &rule_list, &update_type, logger, feather->cumulative_update_off);
|
rule_num=get_rm_key_list(mr_ctx->read_ctx, version, feather->load_version_from, &new_version, &rule_list, &update_type, logger, feather->cumulative_update_off);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include "stream_fuzzy_hash.h"
|
#include "stream_fuzzy_hash.h"
|
||||||
#include "gram_index_engine.h"
|
#include "gram_index_engine.h"
|
||||||
|
|
||||||
int MAAT_FRAME_VERSION_2_4_20181126=1;
|
int MAAT_FRAME_VERSION_2_4_20181127=1;
|
||||||
|
|
||||||
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
||||||
"unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""};
|
"unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""};
|
||||||
|
|||||||
Reference in New Issue
Block a user