@opengis/fastify-table 2.0.40 → 2.0.42
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRedis.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/redis/funcs/getRedis.ts"],"names":[],"mappings":"AAOA,iBAAS,QAAQ,CACf,EACE,EAAE,EACF,
|
|
1
|
+
{"version":3,"file":"getRedis.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/redis/funcs/getRedis.ts"],"names":[],"mappings":"AAOA,iBAAS,QAAQ,CACf,EACE,EAAE,EACF,IAAI,EACJ,IAAI,GACL,GAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACH,OAsBd;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -3,18 +3,18 @@ import { Redis } from "ioredis";
|
|
|
3
3
|
// import Redis from 'ioredis';
|
|
4
4
|
import config from "../../../../config.js";
|
|
5
5
|
import redisClients from "./redisClients.js";
|
|
6
|
-
function getRedis({ db, host
|
|
6
|
+
function getRedis({ db, host, port, } = { db: 0 }) {
|
|
7
7
|
if (!config.redis && !host)
|
|
8
8
|
return null;
|
|
9
|
-
const key = [host, port, db].join("-");
|
|
9
|
+
const key = host || port ? [host, port, db].join("-") : db;
|
|
10
10
|
if (redisClients[key]) {
|
|
11
11
|
return redisClients[key];
|
|
12
12
|
}
|
|
13
13
|
const redisConfig = {
|
|
14
14
|
db,
|
|
15
15
|
keyPrefix: `${config.db}:`,
|
|
16
|
-
host: config.redis?.host ||
|
|
17
|
-
port: config.redis?.port ||
|
|
16
|
+
host: host || config.redis?.host || "127.0.0.1",
|
|
17
|
+
port: port || config.redis?.port || 6379, // Redis port
|
|
18
18
|
family: 4, // 4 (IPv4) or 6 (IPv6)
|
|
19
19
|
closeClient: true,
|
|
20
20
|
};
|