mirror of
https://github.com/SunRed/haste-server.git
synced 2024-11-23 17:50:19 +01:00
Handle redis error and re-establish connection
This commit is contained in:
parent
ad7702aaf4
commit
bf2b1c957a
1 changed files with 5 additions and 0 deletions
|
@ -29,6 +29,11 @@ RedisDocumentStore.connect = function(options) {
|
||||||
if (options.password) {
|
if (options.password) {
|
||||||
RedisDocumentStore.client.auth(options.password);
|
RedisDocumentStore.client.auth(options.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RedisDocumentStore.client.on('error', function(err) {
|
||||||
|
winston.error('redis disconnected', err);
|
||||||
|
});
|
||||||
|
|
||||||
RedisDocumentStore.client.select(index, function(err) {
|
RedisDocumentStore.client.select(index, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
winston.error(
|
winston.error(
|
||||||
|
|
Loading…
Reference in a new issue