⬅️ Reverted changes
This commit is contained in:
@@ -2,7 +2,7 @@ import { createClient } from "redis";
|
|||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
|
|
||||||
// Ensure that the REDIS_URI environment variable is set
|
// Ensure that the REDIS_URI environment variable is set
|
||||||
const redisURL = process.env.REDIS_URI ? new URL(process.env.REDIS_URI) : null;
|
const redisURL = process.env.REDIS_URI;
|
||||||
if (!redisURL) {
|
if (!redisURL) {
|
||||||
throw new Error("REDIS_URI environment variable is not set.");
|
throw new Error("REDIS_URI environment variable is not set.");
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ if (!redisURL) {
|
|||||||
// Function to create a Redis client
|
// Function to create a Redis client
|
||||||
const createRedisClient = (url) => {
|
const createRedisClient = (url) => {
|
||||||
const client = createClient({ url });
|
const client = createClient({ url });
|
||||||
|
console.log(client)
|
||||||
client.on("error", (err) => {
|
client.on("error", (err) => {
|
||||||
console.error("Redis Client Error", err);
|
console.error("Redis Client Error", err);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ const brokerConfig: BrokerOptions = {
|
|||||||
// More info: https://moleculer.services/docs/0.14/networking.html
|
// 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.
|
// 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.
|
// In production you can set it via `TRANSPORTER=nats://localhost:4222` environment variable.
|
||||||
transporter: process.env.REDIS_URI || "redis://127.0.0.1:6379",
|
transporter: process.env.REDIS_URI || "redis://localhost:6379",
|
||||||
|
|
||||||
// Define a cacher.
|
// Define a cacher.
|
||||||
// More info: https://moleculer.services/docs/0.14/caching.html
|
// More info: https://moleculer.services/docs/0.14/caching.html
|
||||||
|
|||||||
Reference in New Issue
Block a user