You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
20 lines
398 B
JavaScript
20 lines
398 B
JavaScript
import Redis from 'ioredis';
|
|
|
|
const client = new Redis({ lazyConnect: true });
|
|
|
|
export function setup() {
|
|
return client.connect();
|
|
}
|
|
|
|
export function benchmark({ randomString }) {
|
|
return Promise.all([
|
|
client.set(randomString, randomString),
|
|
client.get(randomString),
|
|
client.del(randomString)
|
|
]);
|
|
}
|
|
|
|
export function teardown() {
|
|
return client.disconnect();
|
|
}
|