RedisClientConfig.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace OASystem.RedisRepository.Config
  7. {
  8. internal class RedisClientConfig
  9. {
  10. //private static string _server = ConfigHelper.Get("RedisServer", "132.232.92.186");
  11. private static string _server = "132.232.92.186";
  12. /// <summary>
  13. /// 腾讯云Redis节点IP
  14. /// </summary>
  15. public static string Server
  16. {
  17. get { return _server; }
  18. set { _server = value; }
  19. }
  20. //private static int _port = ConfigHelper.Get("RedisPort", 6379);
  21. private static int _port = 6379;
  22. /// <summary>
  23. /// 节点端口
  24. /// </summary>
  25. public static int Port
  26. {
  27. get { return _port; }
  28. set { _port = value; }
  29. }
  30. //private static string _slaveServer = ConfigHelper.Get("SlaveServer", "132.232.92.186");
  31. private static string _slaveServer = "132.232.92.186";
  32. /// <summary>
  33. /// 节点IP
  34. /// </summary>
  35. public static string SlaveServer
  36. {
  37. get { return _slaveServer; }
  38. set { _slaveServer = value; }
  39. }
  40. //private static int _slavePort = ConfigHelper.Get("SlavePort", 6380);
  41. private static int _slavePort = 6380;
  42. /// <summary>
  43. /// 节点端口
  44. /// </summary>
  45. public static int SlavePort
  46. {
  47. get { return _slavePort; }
  48. set { _slavePort = value; }
  49. }
  50. //private static string _auth = ConfigHelper.Get("RedisAuth", "123456");
  51. private static string _auth = "123456";
  52. /// <summary>
  53. /// 节点密码
  54. /// </summary>
  55. public static string RedisAuth
  56. {
  57. get { return _auth; }
  58. set { _auth = value; }
  59. }
  60. //private static int _defaultDatabase = ConfigHelper.Get("RedisDataBase", 0);
  61. private static int _defaultDatabase = 0;
  62. /// <summary>
  63. /// redis默认0号库
  64. /// </summary>
  65. public static int DefaultDatabase
  66. {
  67. get { return _defaultDatabase; }
  68. set { _defaultDatabase = value; }
  69. }
  70. private static int _connectTimeout = 10000;
  71. public static int ConnectTimeout
  72. {
  73. get { return _connectTimeout; }
  74. set { _connectTimeout = value; }
  75. }
  76. private static int _connectRetry = 3;
  77. public static int ConnectRetry
  78. {
  79. get { return _connectRetry; }
  80. set { _connectRetry = value; }
  81. }
  82. private static bool _preserveAsyncOrder = false;
  83. public static bool PreserveAsyncOrder
  84. {
  85. get { return _preserveAsyncOrder; }
  86. set { _preserveAsyncOrder = value; }
  87. }
  88. }
  89. }