options.server = {
auto_reconnect: true,
poolSize: 5,
socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 },
reconnectTries: 3000
};
var db = mongoose.createConnection('mongodb://localhost/test', options);
mongoose.connection.on('error', function(err) {
console.log('MONGODB ERROR MONGOOSE LEVEL ',err);
});
db.on('connecting', function() {
console.info('MONGODB connecting.');
});
db.on('error', function(err) {
console.log('MONGODB ERROR ', err);
});
db.on('close', function(err) {
console.log('MONGODB CLOSE ', err);
});
db.on('connected', function() {
console.info('MONGODB connected successfully.');
});
db.once('open', function callback() {
console.info('MONGODB opened successfully.');
});
db.on('reconnected', function() {
console.info('MONGODB reconnected.');
});
db.on('timeout', function() {
console.info('MONGODB timeout.');
});
db.on('disconnected', function() {
console.info('MONGODB disconnected');
});
1. adblock plus, при установке импортировался https://easylist-downloads.adblockplus.org/advblock.txt
2. Disconnect