Skip to content

Commit

Permalink
persistence.commit callback can be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
vanchi-zendesk committed Feb 19, 2014
1 parent afc574e commit f2db1ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/lib/persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function sentinelConnect(sentinelPort, sentinelHost, masterName, redisAuth) {
Persistence.connect = function(done) {

if(client_connected && subscriber_connected) {
done(); //already connected
if(done) done(); //already connected
return;
}
//create a client (read/write)
Expand Down Expand Up @@ -70,7 +70,7 @@ Persistence.connect = function(done) {
if(configuration.db) {
client.select(configuration.db, done);
} else {
done();
if(done) done();
}
}
});
Expand All @@ -80,7 +80,7 @@ Persistence.connect = function(done) {
subscriber.once('ready', function() {
subscriber_connected = true;
if(client_connected && subscriber_connected) {
done();
if(done) done();
}
});
}
Expand Down

0 comments on commit f2db1ae

Please sign in to comment.