user1234
user1234

Reputation: 335

Error: Error: Redis connection gone from close event

while running following code

for (var i= 0; i< 20; i++) {
        redisClient.lindex("devices", i, function (errorMessage, DeviceList) {
          for (var j= 0; j< 20; j++) {
              var deviceCoordinateList = resultData[j].split(',');
              var deviceCoordinate = deviceCoordinateList[0]+i+ ','+deviceCoordinateList [1]+i;
              redisClient.lpush(DeviceList, deviceCoordinate, redisInitialise.print);
            }
        });
    }

i am getting the error:

Error: Error: Redis connection gone from close event.

how to fix it ?

Upvotes: 0

Views: 669

Answers (1)

user4155815
user4155815

Reputation:

you might be doing something wrong. I think you are writing redis quit() function at wrong place

redisClient.quit();

Upvotes: 3

Related Questions