dt-common-device 8.0.9 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,6 @@ export declare function getDTApiKey(): string;
29
29
  export declare function getRedisDbHostAndPort(): {
30
30
  host: string;
31
31
  port: number;
32
- nodeEnv: string;
33
32
  };
34
33
  /**
35
34
  * Graceful shutdown function
@@ -270,12 +270,11 @@ function getDTApiKey() {
270
270
  function getRedisDbHostAndPort() {
271
271
  const host = process.env.REDIS_HOST;
272
272
  const port = process.env.REDIS_PORT;
273
- const nodeEnv = process.env.NODE_ENV;
274
- if (!host || !port || !nodeEnv) {
273
+ if (!host || !port) {
275
274
  getConfig().LOGGER.error("REDIS_HOST and REDIS_PORT must be set in environment variables");
276
275
  throw new Error("dt-common-device: REDIS_HOST and REDIS_PORT must be set in environment variables");
277
276
  }
278
- return { host, port: Number(port), nodeEnv };
277
+ return { host, port: Number(port) };
279
278
  }
280
279
  /**
281
280
  * Graceful shutdown function
package/dist/db/redis.js CHANGED
@@ -10,16 +10,10 @@ const ioredis_1 = __importDefault(require("ioredis"));
10
10
  let redisClient = null;
11
11
  function getRedisClient() {
12
12
  if (!redisClient) {
13
- const { host, port, nodeEnv } = (0, config_1.getRedisDbHostAndPort)();
14
- const isGreenEcs = nodeEnv === "green-ecs";
13
+ const { host, port } = (0, config_1.getRedisDbHostAndPort)();
15
14
  redisClient = new ioredis_1.default({
16
15
  host,
17
16
  port,
18
- tls: isGreenEcs
19
- ? {
20
- rejectUnauthorized: false, // required for AWS ElastiCache TLS
21
- }
22
- : undefined, // no TLS for dev/QA/UAT
23
17
  lazyConnect: true,
24
18
  enableReadyCheck: false,
25
19
  connectTimeout: 10000,
@@ -29,10 +23,10 @@ function getRedisClient() {
29
23
  console.error("Redis error:", error);
30
24
  });
31
25
  redisClient.on("connect", () => {
32
- console.log(" Redis connected successfully");
26
+ console.log(" Redis connected successfully");
33
27
  });
34
28
  redisClient.on("ready", () => {
35
- console.log(" Redis ready for operations");
29
+ console.log(" Redis ready for operations");
36
30
  });
37
31
  }
38
32
  return redisClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "8.0.9",
3
+ "version": "9.0.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [