yxx4c / prisma-extension-redis

Extensive Prisma extension designed for efficient caching and cache invalidation using Redis and Dragonfly Databases
https://npmjs.com/package/prisma-extension-redis
MIT License
34 stars 2 forks source link

I already have configured a client for redis #19

Closed moshOntong-IT closed 3 hours ago

moshOntong-IT commented 3 hours ago
import { Redis } from "ioredis";
import logger from "./winston-config";
const redisClient = new Redis(process.env.REDIS_URL!);

redisClient.on("error", (error) => {
  logger.error(`Redis error: ${error}`);
});

redisClient.on("connect", () => {
  logger.info("Connected to Redis");
});

export default redisClient;

I already configure how can I put this on PrismaExtensionRedis?

moshOntong-IT commented 3 hours ago

I am using the new version, so it works fine when I have another instance of redis client since it is given in the package that we can pass that redis client on your extensions. Now since the latest version seems need a new instance of redis. Hence when I saw it my logs it got an error when there is a 2 instance of redis. when I temporarily disable your extension my main redis client works find.

@yxx4c

moshOntong-IT commented 3 hours ago

Ini your redis configuration, it seems I have misconfigured the redis. I set up like this


{
 host: localhost
 port:4222
 }

 seems
moshOntong-IT commented 3 hours ago

Anyways I fixed seems the confguration is the cause but I hope we will have configuration that we can pass the client instance that already set up