@aquiles-ai/aquiles-rag-js
Version:
Aquiles-RAG-JS variant made in Fastify to continue the high-performance philosophy of the Python version with FastAPI
16 lines (14 loc) • 431 B
JavaScript
import { getConnection } from "../connection/connection.js";
import fp from 'fastify-plugin';
export default fp(async function RedisConPl(fastify) {
const client = await getConnection();
fastify.decorate('redis', client);
fastify.addHook('onClose', async (instance, done) => {
try {
await client.close();
} catch (err) {
fastify.log.error('Error cerrando Redis', err);
}
done();
});
})