Commit 55e015ed4dc7770ede5dcf0e00353215a54023fd

Authored by Adhidarma Hadiwinoto
1 parent 449ed021da
Exists in master

RedisClient fixed

Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff

lib/messages-archive.js
... ... @@ -27,8 +27,11 @@ function composeRedisCounterKeyword(origin, direction) {
27 27 }
28 28  
29 29 function incrementCounter(origin, direction) {
30   - logger.warn('Undefined redisClient, not incrementing messages counter! #FF8E765E12E2');
31   - redisClient && redisClient.INCR(composeRedisCounterKeyword(origin, direction), () => {});
  30 + if (!redisClient) {
  31 + logger.warn('Undefined redisClient, not incrementing messages counter! #FF8E765E12E2');
  32 + } else {
  33 + redisClient.INCR(composeRedisCounterKeyword(origin, direction), () => {});
  34 + }
32 35 }
33 36  
34 37 /**