Skip to content

Commit

Permalink
refactor: limit info on readyCheck to persistence section
Browse files Browse the repository at this point in the history
  • Loading branch information
ejose19 committed Mar 4, 2021
1 parent ee294b6 commit 64203b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file added dump.rdb
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/redis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ Redis.prototype.flushQueue = function (error, options) {
*/
Redis.prototype._readyCheck = function (callback) {
const _this = this;
this.info(function (err, res) {
this.info('persistence', function (err, res) {
if (err) {
return callback(err);
}
Expand Down
4 changes: 2 additions & 2 deletions test/functional/ready_check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("ready_check", function () {
it("should retry when redis is not ready", function (done) {
const redis = new Redis({ lazyConnect: true });

sinon.stub(redis, "info").callsFake((callback) => {
sinon.stub(redis, "info").callsFake((_section, callback) => {
callback(null, "loading:1\r\nloading_eta_seconds:7");
});
// @ts-ignore
Expand All @@ -28,7 +28,7 @@ describe("ready_check", function () {
},
});

sinon.stub(redis, "info").callsFake((callback) => {
sinon.stub(redis, "info").callsFake((_section, callback) => {
callback(new Error("info error"));
});

Expand Down

0 comments on commit 64203b3

Please sign in to comment.