client.on("error", function (err) { console.log("Error " + err); });
redisClient.on('error', err => { console.log('Redis err') console.log(err) })
setup() { this.redisConfig = Object.assign({}, redisBaseConfig, this.options) this.redisClient = Redis.createClient(this.redisConfig) this.redisClient.on("error", function(error) { console.error(`❗️ Redis Error: ${error}`) }) this.redisClient.on("ready", () => { console.log('✅ 💃 redis have ready !') }) this.redisClient.on("connect", () => { console.log('✅ 💃 connect redis success !') }) }
sub.on('subscribe', function (channel, count) { sub.getAsync(`chave-${line}`) .then(data => { console.log(data); }) .catch(err => console.log(err)); });
// handle received messages from redis, for synchronization between servers sub.on("message", function (channel, message) { var data = JSON.parse(message); if (data.data != null) { mergeMessages(data.data); } else { messages.push(data); } });
redis .createClient( nconf.get('redisPort') || '6379', nconf.get('redisHost') || '127.0.0.1', { auth_pass: nconf.get('redisKey'), return_buffers: true, } ) .on('error', err => console.error('ERR:REDIS:', err))
sub.on('message', function(channel, message) { if (channel !== 'fruum') return; try { message = JSON.parse(message); _.each(that.getCallbacks(), function(cb) { cb(message); }); } catch (err) {} });
subscriber.on("message", function(channel, message) { messageCount += 1; console.log("Subscriber recebeu uma menssagem do canal '" + channel + "': " + message); if (messageCount === 2) { subscriber.unsubscribe(); subscriber.quit(); publisher.quit(); } });
sub.on('subscribe', function(channel) { if (channel === 'fruum') { ready = true; logger.system('Redis dispatch connected'); } });
client.on("error", function(err) { console.log("redis client Error " + err); console.log("reconnecting~~~~~~~"); client=redis.createClient(config.redis_port, 'redis.duapp.com', { "no_ready_check": true }); initSession(_app); });
// used locally for example (no params) // Handle errors immediately. Errors on sockets, or errors between server and // client, propagate back to the top of the stack. If not handled, the process // will exit. Failure to handle errors properly will also leave DB connections // open (memory leaks, unresponsiveness). client.on('error', function(err) { // console.log('ERROR (redis.js): ' + err); throw err; });
clientB.on('connect', () => { log('client B connected'); conn += 1; if(conn === 2) cb(); });
//1h redisClient.on('error', function (err) { console.log('redis Error:' + err); })
redisClient.on('error', err => { // swallow errors to allow retries as specified in the retry_strategy above console.log(`redis client error: ${err}`); });