@balena/open-balena-api 26.3.4-build-standardize-redis-settings-4fa02d47074825ac49b13f002e152b98508761ae-1 → 26.3.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -5,16 +5,13 @@ import { REDIS } from '../../lib/config.js';
|
|
5
5
|
in case the redis server goes offline and comes online again.
|
6
6
|
*/
|
7
7
|
const redisRetryStrategy = _.constant(200);
|
8
|
-
const keepAlive = 0;
|
9
|
-
const connectTimeout = 10000;
|
10
8
|
export const getRedisOptions = ({ readOnly = false, instance = 'general', enableAutoPipelining = true, } = {}) => {
|
11
9
|
const r = REDIS[instance];
|
12
10
|
const redisOptions = {
|
13
11
|
retryStrategy: redisRetryStrategy,
|
14
12
|
enableOfflineQueue: false,
|
15
13
|
enableAutoPipelining,
|
16
|
-
keepAlive,
|
17
|
-
connectTimeout,
|
14
|
+
keepAlive: 0,
|
18
15
|
};
|
19
16
|
if (r.isCluster) {
|
20
17
|
return {
|
@@ -42,11 +39,7 @@ const hostPortToUrl = (h) => `redis://${h.host}:${h.port}`;
|
|
42
39
|
export const getNodeRedisOptions = ({ readOnly = false, instance = 'general', } = {}) => {
|
43
40
|
const r = REDIS[instance];
|
44
41
|
const redisOptions = {
|
45
|
-
socket: {
|
46
|
-
connectTimeout,
|
47
|
-
keepAlive,
|
48
|
-
reconnectStrategy: redisRetryStrategy,
|
49
|
-
},
|
42
|
+
socket: { reconnectStrategy: redisRetryStrategy },
|
50
43
|
disableOfflineQueue: true,
|
51
44
|
};
|
52
45
|
if (r.isCluster) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/infra/redis/config.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAGvB,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C;;;EAGE;AACF,MAAM,kBAAkB,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAE3C,MAAM,
|
1
|
+
{"version":3,"file":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AAI,EAAE,CAAC;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EACnC,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,SAAS,MAIjB,EAAE,EAAgE,EAAE;IACvE,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;IAE1B,MAAM,YAAY,GAAiC;QAClD,MAAM,EAAE,EAAE,iBAAiB,EAAE,kBAAkB,EAAE;QACjD,mBAAmB,EAAE,IAAI;KACzB,CAAC;IAEF,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO;YACN,qFAAqF;YACrF,gEAAgE;YAChE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC5B,OAAO,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;YAClC,CAAC,CAAC;YACF,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE;gBACT,GAAG,CAAC,CAAC,IAAI;gBACT,GAAG,YAAY;aACf;SACD,CAAC;IACH,CAAC;SAAM,CAAC;QACP,OAAO;YACN,GAAG,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAChD,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACjC,GAAG,YAAY;SACf,CAAC;IACH,CAAC;AACF,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@balena/open-balena-api",
|
3
3
|
"description": "Internet of things, Made Simple",
|
4
|
-
"version": "26.3.4
|
4
|
+
"version": "26.3.4",
|
5
5
|
"license": "AGPL-3.0",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
@@ -167,6 +167,6 @@
|
|
167
167
|
"loader": "ts-node/esm/transpile-only"
|
168
168
|
},
|
169
169
|
"versionist": {
|
170
|
-
"publishedAt": "2024-08-
|
170
|
+
"publishedAt": "2024-08-26T01:15:33.702Z"
|
171
171
|
}
|
172
172
|
}
|