Karathan 6 years ago
parent
commit
3832467327
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      AuctionTracker/Program.cs

+ 11
- 1
AuctionTracker/Program.cs View File

26
         private static IEnumerable<Auction> lastAuctions;
26
         private static IEnumerable<Auction> lastAuctions;
27
         private static IConfiguration _configuration;
27
         private static IConfiguration _configuration;
28
         private static ILog _logger;
28
         private static ILog _logger;
29
+        private static string _redisPass;
29
 
30
 
30
         private static RedisManagerPool _redisPool;
31
         private static RedisManagerPool _redisPool;
31
         private static string _character;
32
         private static string _character;
119
             _character = _configuration["character"];
120
             _character = _configuration["character"];
120
             _locale = _configuration["locale"];
121
             _locale = _configuration["locale"];
121
             _realm = _configuration["realm"];
122
             _realm = _configuration["realm"];
123
+            _redisPass = _configuration["redisPassword"];
122
             _logger.Info("Creating Clients");
124
             _logger.Info("Creating Clients");
123
             _client = new BlizzSharpClient($"{_configuration["blizzardApiKey"]}");
125
             _client = new BlizzSharpClient($"{_configuration["blizzardApiKey"]}");
124
             _pushClient = new PushClient($"{_configuration["pushoverSecretKey"]}", $"{_configuration["pushoverUserKey"]}");
126
             _pushClient = new PushClient($"{_configuration["pushoverSecretKey"]}", $"{_configuration["pushoverUserKey"]}");
125
             _logger.Info("Initializing redis pool");
127
             _logger.Info("Initializing redis pool");
126
-            _redisPool = new RedisManagerPool("localhost:6379");
128
+            if(string.IsNullOrEmpty(_redisPass))
129
+            {
130
+                _redisPool = new RedisManagerPool("localhost:6379");
131
+            }
132
+            else
133
+            {
134
+                _redisPool = new RedisManagerPool($"{_redisPass}@localhost:6379");
135
+            }
136
+            
127
             _logger.Info("AuctionTracker started, entering loop");
137
             _logger.Info("AuctionTracker started, entering loop");
128
 
138
 
129
             while(true)
139
             while(true)