Skip to content

Commit

Permalink
redislab이 hello를 구현하지 않아서 info로 레디스 버전 유도
Browse files Browse the repository at this point in the history
  • Loading branch information
if1live committed Sep 30, 2023
1 parent e714d97 commit 936322a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ const touchRedisNaive = async (input: RedisNativeInput): Promise<object> => {
const redis = new Redis(options);
await redis.connect();

const tokens = await redis.hello();
const version = tokens[3];
// redislab은 hello를 구현하지 않은듯
// {"name":"gE","message":"ERR unknown command 'hello'"}
const text = await redis.info();
const lines = text.split("\r\n");
const line_version = lines.find((line) => line.startsWith("redis_version:"));
const version = line_version?.split(":")[1];

redis.disconnect(false);

Expand Down

0 comments on commit 936322a

Please sign in to comment.