🔧 Fixed the Redis disconnection issue

This commit is contained in:
2024-05-17 01:26:16 -04:00
parent 8dcb17a6a0
commit cc772504ae
9 changed files with 65 additions and 107 deletions

View File

@@ -5,6 +5,7 @@ import {
MetricRegistry,
ServiceBroker,
} from "moleculer";
const RedisTransporter = require("moleculer").Transporters.Redis;
/**
* Moleculer ServiceBroker configuration file
@@ -90,7 +91,7 @@ const brokerConfig: BrokerOptions = {
// More info: https://moleculer.services/docs/0.14/networking.html
// Note: During the development, you don't need to define it because all services will be loaded locally.
// In production you can set it via `TRANSPORTER=nats://localhost:4222` environment variable.
transporter: process.env.REDIS_URI,
transporter: new RedisTransporter(process.env.REDIS_URI),
// Define a cacher.
// More info: https://moleculer.services/docs/0.14/caching.html