"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fastify_plugin_1 = __importDefault(require("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);
};
exports.default = fastify_plugin_1.default(redisPlugin);
//# sourceMappingURL=redis.js.map