Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ var status = require('pomelo-status-plugin');

app.use(status, {status: {
host: '127.0.0.1',
port: 6379
port: 6379,
db: 1,
}});

```
Expand Down Expand Up @@ -75,6 +76,7 @@ var mysqlStatusManager = require('./mysqlStatusManager');
app.use(status, {status: {
host: '127.0.0.1',
port: 6379,
db: 1,
channelManager: mysqlStatusManager
}});

Expand All @@ -85,6 +87,7 @@ in >=0.0.3 version add cleanOnStartUp option, when you enable this option, statu
app.use(status, {status: {
host: '127.0.0.1',
port: 6379,
db: 1,
cleanOnStartUp: true
}});

Expand Down
6 changes: 6 additions & 0 deletions lib/manager/statusManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ StatusManager.prototype.start = function(cb) {
if (this.opts.auth_pass) {
this.redis.auth(this.opts.auth_pass);
}
var db = this.opts.db || 0;
this.redis.select(db, function (err) {
if (!!err) {
console.error("[status-plugin][redis]" + err.stack);
}
});
this.redis.on("error", function (err) {
console.error("[status-plugin][redis]" + err.stack);
});
Expand Down