Commit 2e3adb5d4fa6bde5022e39ba34d085b909fef3ea

Authored by Adhidarma Hadiwinoto
1 parent f7036c8a03
Exists in master

Warn on no redis

Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff

lib/messages-archive.js
... ... @@ -11,6 +11,14 @@ const DIRECTION_OUTGOING = 1;
11 11  
12 12 const redisClient = config.redis && redis.createClient(config.redis);
13 13  
  14 +if (!config.redis) {
  15 + logger.warn('Undefined config.redis, messages counter will not work! #05A778E21D7E');
  16 +}
  17 +
  18 +if (!redisClient) {
  19 + logger.warn('Undefined redisClient, messages counter will not work! #1D3EC165E8D9');
  20 +}
  21 +
14 22 function composeRedisCounterKeyword(origin, direction) {
15 23 const directionLabel = direction == DIRECTION_OUTGOING ? 'OUT' : 'IN';
16 24 return `CALMA_MESSAGE_COUNTER_${origin}_${directionLabel}`;