浏览代码

ndb_redis: renamed parameter flush_db_on_reconnect to flush_on_reconnect

Daniel-Constantin Mierla 8 年之前
父节点
当前提交
4bb9a95ec6

+ 9 - 9
src/modules/ndb_redis/doc/ndb_redis_admin.xml

@@ -221,7 +221,7 @@ modparam("ndb_redis", "allowed_timeouts", 3)
 	<section id="ndb_redis.p.disable_time">
 		<title><varname>disable_time</varname> (integer)</title>
 		<para>
-			If allowed_timeouts is set to a non negative value this determines the 
+			If allowed_timeouts is set to a non negative value this determines the
 			number of seconds the REDIS server will be disabled
 		</para>
 		<para>
@@ -239,21 +239,21 @@ modparam("ndb_redis", "disable_time", 30)
 			</programlisting>
 		</example>
 	</section>
-	<section id="ndb_redis.p.flush_db_on_reconnect">
-		<title><varname>flush_db_on_reconnect</varname> (integer)</title>
+	<section id="ndb_redis.p.flush_on_reconnect">
+		<title><varname>flush_on_reconnect</varname> (integer)</title>
 		<para>
 			If this is set to a non zero value, a "FLUSHALL" command is
-			issued after reconnecting to a REDIS server, to clear the 
-			entire database. 
+			issued after reconnecting to a REDIS server, to clear the
+			entire database.
 		</para>
 		<para>
 			When a command to a REDIS server fails, a reconnection
 			to that server is made, so with this parameter each failed
-			command will result in a flush of the database. 
+			command will result in a flush of the database.
 		</para>
 		<para>
 			This is useful in scenarios when a REDIS server does not respond
-			to commands, but the commands might have been issued, and the 
+			to commands, but the commands might have been issued, and the
 			responses lost. If this leaves the data in the db in an uncertain
 			state, a flush might fix any issues that may occur.
 		</para>
@@ -263,10 +263,10 @@ modparam("ndb_redis", "disable_time", 30)
 		</emphasis>
 		</para>
 		<example>
-			<title>Set <varname>flush_db_on_reconnect</varname> parameter</title>
+			<title>Set <varname>flush_on_reconnect</varname> parameter</title>
 			<programlisting format="linespecific">
 ...
-modparam("ndb_redis", "flush_db_on_reconnect", 1)
+modparam("ndb_redis", "flush_on_reconnect", 1)
 ...
 			</programlisting>
 		</example>

+ 2 - 2
src/modules/ndb_redis/ndb_redis_mod.c

@@ -50,7 +50,7 @@ int redis_cmd_timeout_param = 1000;
 int redis_cluster_param = 0;
 int redis_disable_time_param=0;
 int redis_allowed_timeouts_param=-1;
-int redis_flush_db_on_reconnect_param=0;
+int redis_flush_on_reconnect_param=0;
 
 static int w_redis_cmd3(struct sip_msg* msg, char* ssrv, char* scmd,
 		char* sres);
@@ -125,7 +125,7 @@ static param_export_t params[]={
 	{"cluster", INT_PARAM, &redis_cluster_param},
 	{"disable_time", INT_PARAM, &redis_disable_time_param},
 	{"allowed_timeouts", INT_PARAM, &redis_allowed_timeouts_param},
-	{"flush_db_on_reconnect", INT_PARAM, &redis_flush_db_on_reconnect_param},
+	{"flush_on_reconnect", INT_PARAM, &redis_flush_on_reconnect_param},
 	{0, 0, 0}
 };
 

+ 2 - 2
src/modules/ndb_redis/redis_client.c

@@ -51,7 +51,7 @@ extern int redis_cmd_timeout_param;
 extern int redis_cluster_param;
 extern int redis_disable_time_param;
 extern int redis_allowed_timeouts_param;
-extern int redis_flush_db_on_reconnect_param;
+extern int redis_flush_on_reconnect_param;
 
 /* backwards compatibility with hiredis < 0.12 */
 #if (HIREDIS_MAJOR == 0) && (HIREDIS_MINOR < 12)
@@ -375,7 +375,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
 		goto err2;
 	if ((redis_cluster_param == 0) && redisCommandNR(rsrv->ctxRedis, "SELECT %i", db))
 		goto err2;
-	if (redis_flush_db_on_reconnect_param)
+	if (redis_flush_on_reconnect_param)
 		if (redisCommandNR(rsrv->ctxRedis, "FLUSHALL"))
 			goto err2;
 	return 0;