@balena/open-balena-api 26.4.0-build-v7-c92792343afae067ff6e23d7498d59f67e0ac875-1 → 26.4.0-build-v7-50da5cf46b2f090cf6df69946d2558c0766e2e57-1
Sign up to get free protection for your applications and to get access to all the features.
@@ -5,13 +5,16 @@ 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;
|
8
10
|
export const getRedisOptions = ({ readOnly = false, instance = 'general', enableAutoPipelining = true, } = {}) => {
|
9
11
|
const r = REDIS[instance];
|
10
12
|
const redisOptions = {
|
11
13
|
retryStrategy: redisRetryStrategy,
|
12
14
|
enableOfflineQueue: false,
|
13
15
|
enableAutoPipelining,
|
14
|
-
keepAlive
|
16
|
+
keepAlive,
|
17
|
+
connectTimeout,
|
15
18
|
};
|
16
19
|
if (r.isCluster) {
|
17
20
|
return {
|
@@ -39,7 +42,11 @@ const hostPortToUrl = (h) => `redis://${h.host}:${h.port}`;
|
|
39
42
|
export const getNodeRedisOptions = ({ readOnly = false, instance = 'general', } = {}) => {
|
40
43
|
const r = REDIS[instance];
|
41
44
|
const redisOptions = {
|
42
|
-
socket: {
|
45
|
+
socket: {
|
46
|
+
connectTimeout,
|
47
|
+
keepAlive,
|
48
|
+
reconnectStrategy: redisRetryStrategy,
|
49
|
+
},
|
43
50
|
disableOfflineQueue: true,
|
44
51
|
};
|
45
52
|
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,CAAC,MAAM,eAA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AC,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.4.0-build-v7-
|
4
|
+
"version": "26.4.0-build-v7-50da5cf46b2f090cf6df69946d2558c0766e2e57-1",
|
5
5
|
"license": "AGPL-3.0",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
@@ -168,6 +168,6 @@
|
|
168
168
|
"loader": "ts-node/esm/transpile-only"
|
169
169
|
},
|
170
170
|
"versionist": {
|
171
|
-
"publishedAt": "2024-08-27T08:
|
171
|
+
"publishedAt": "2024-08-27T08:59:17.333Z"
|
172
172
|
}
|
173
173
|
}
|