Browse Source

redis添加默认数据库可配

lihai 6 years ago
parent
commit
59d1401c5e

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Configs/system.config

@@ -33,6 +33,7 @@
33 33
   <!-- ================== 5:Redis配置 ================== -->
34 34
   <add key="Redis_Server" value="192.168.4.18" />
35 35
   <add key="Redis_Port" value="6379" />
36
+  <add key="Redis_Defaultdatabase" value="2" />
36 37
   <!-- 录音存储地址 -->
37 38
   <add key="Sound_recording" value="D:\CallCenter_Sound\" />
38 39
 </appSettings>

+ 1 - 1
codegit/CallCenterCommon/CallCenter.Utility/RedisHelper.cs

@@ -20,7 +20,7 @@ namespace CallCenter.Utility
20 20
                 redis = ConnectionMultiplexer.Connect(Configs.GetValue("Redis_Server") + ":" + Configs.GetValue("Redis_Port"));
21 21
                 //redis = ConnectionMultiplexer.Connect("192.168.4.18, abortConnect=false");
22 22
 
23
-                database = redis.GetDatabase(10);
23
+                database = redis.GetDatabase(int.Parse(Configs.GetValue("Redis_Defaultdatabase")));
24 24
             }
25 25
         }
26 26