Karathan пре 6 година
родитељ
комит
3832467327
1 измењених фајлова са 11 додато и 1 уклоњено
  1. 11
    1
      AuctionTracker/Program.cs

+ 11
- 1
AuctionTracker/Program.cs Прегледај датотеку

@@ -26,6 +26,7 @@ namespace AuctionTracker
26 26
         private static IEnumerable<Auction> lastAuctions;
27 27
         private static IConfiguration _configuration;
28 28
         private static ILog _logger;
29
+        private static string _redisPass;
29 30
 
30 31
         private static RedisManagerPool _redisPool;
31 32
         private static string _character;
@@ -119,11 +120,20 @@ namespace AuctionTracker
119 120
             _character = _configuration["character"];
120 121
             _locale = _configuration["locale"];
121 122
             _realm = _configuration["realm"];
123
+            _redisPass = _configuration["redisPassword"];
122 124
             _logger.Info("Creating Clients");
123 125
             _client = new BlizzSharpClient($"{_configuration["blizzardApiKey"]}");
124 126
             _pushClient = new PushClient($"{_configuration["pushoverSecretKey"]}", $"{_configuration["pushoverUserKey"]}");
125 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 137
             _logger.Info("AuctionTracker started, entering loop");
128 138
 
129 139
             while(true)