How to use the redis.ReplyError function in redis

To help you get started, we’ve selected a few redis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shalvah / RemindMeOfThisTweet / handler.js View on Github external
text: tweetObject.full_text || tweetObject.text,
            referencing_tweet: tweetObject.in_reply_to_status_id_str,
            author: tweetObject.user.screen_name,
        };
    });

    try {

        if (allMentions.length) {
            // for failure/recovery purposes
            await cache.setAsync('lastTweetRetrieved', allMentions[allMentions.length - 1].id);
            let results = await Promise.all(allMentions.map(service.handleMention));
            await Promise.all(results.map(service.handleParsingResult));
        }
    } catch (err) {
        if (err instanceof (require("redis")).ReplyError) {
            console.log(`Redis error: ${err.command} ${err.args} ${err}`);
        }
        throw err;
    }

    return http.success(`Handled ${allMentions.length} tweets`);
};
github Jasonhcwong / lnswaps / service / redis_client.js View on Github external
function redisQuit() {
  redisSub.unsubscribe();
  redisSub.quit();
  redisPub.quit();
  redisClient.quit();
}

module.exports = {
  redisPub,
  redisSub,
  redisClient,
  updateRedisOrderAndPublish,
  publishRedisMessage,
  redisQuit,
  ReplyError: redis.ReplyError,
};
github shalvah / RemindMeOfThisTweet / src / cache.js View on Github external
client.on('error', function (err) {
    if (err instanceof redis.ReplyError) {
        console.log(`Redis error: ${err.command} ${err.args} ${err}`);
    }
    throw err;
});
client.authAsync(process.env.REDIS_PASSWORD);