import fp from "fastify-plugin";
const redisPlugin = (fastify, { redisFactory }, done) => {
    const client = redisFactory();
    fastify.decorate("redis", client);
    fastify.decorate("redisFactory", redisFactory);
    fastify.addHook("onClose", async () => {
        await client.quit();
    });
    client.addListener("ready", done);
};
export default fp(redisPlugin);
//# sourceMappingURL=redis.js.map