@alanszp/queue 10.1.0 → 11.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.
|
@@ -17,6 +17,7 @@ class ConnectionManager {
|
|
|
17
17
|
throw new Error("Redis configuration required");
|
|
18
18
|
}
|
|
19
19
|
const redis = new ioredis_1.default(this.redisConfiguration);
|
|
20
|
+
redis.setMaxListeners(20);
|
|
20
21
|
redis.on("connect", () => this.getLogger().info("redis.connected"));
|
|
21
22
|
redis.on("ready", () => this.getLogger().info("redis.ready"));
|
|
22
23
|
redis.on("error", (error) => this.getLogger().error("redis.error", { error }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionManager.js","sourceRoot":"","sources":["../src/connectionManager.ts"],"names":[],"mappings":";;;;;;AACA,sDAA8C;AAE9C,MAAa,iBAAiB;IAWrB,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE;YAC/B,iBAAiB,CAAC,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;SACtD;QAED,OAAO,iBAAiB,CAAC,QAAQ,CAAC;IACpC,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QAED,MAAM,KAAK,GAAG,IAAI,iBAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjD,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACpE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QAC9D,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE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E,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QAC5D,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QAE/D,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,gBAAgB,CACrB,aAA2B,EAC3B,OAAe,EACf,SAAwB;QAExB,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAEM,aAAa;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;SAClC;QAED,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;IAC/B,CAAC;CACF;AAhED,8CAgEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alanszp/queue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Workers and queues",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"typescript": "^4.3.4"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@alanszp/audit": "^
|
|
30
|
-
"@alanszp/core": "^
|
|
31
|
-
"@alanszp/logger": "^
|
|
32
|
-
"@alanszp/shared-context": "^
|
|
33
|
-
"@alanszp/validations": "^
|
|
29
|
+
"@alanszp/audit": "^11.0.0",
|
|
30
|
+
"@alanszp/core": "^11.0.0",
|
|
31
|
+
"@alanszp/logger": "^11.0.0",
|
|
32
|
+
"@alanszp/shared-context": "^11.0.0",
|
|
33
|
+
"@alanszp/validations": "^11.0.0",
|
|
34
34
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
35
35
|
"bullmq": "^2.1.2",
|
|
36
36
|
"ioredis": "^5.2.3",
|
|
37
37
|
"lodash": "^4.17.21"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "60b62fa2fff34ef094ea9af69c2bed2373c70f64"
|
|
40
40
|
}
|
package/src/connectionManager.ts
CHANGED
|
@@ -26,9 +26,12 @@ export class ConnectionManager {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const redis = new Redis(this.redisConfiguration);
|
|
29
|
+
redis.setMaxListeners(20);
|
|
29
30
|
redis.on("connect", () => this.getLogger().info("redis.connected"));
|
|
30
31
|
redis.on("ready", () => this.getLogger().info("redis.ready"));
|
|
31
|
-
redis.on("error", (error: Error) =>
|
|
32
|
+
redis.on("error", (error: Error) =>
|
|
33
|
+
this.getLogger().error("redis.error", { error })
|
|
34
|
+
);
|
|
32
35
|
redis.on("close", () => this.getLogger().warn("redis.closed"));
|
|
33
36
|
redis.on("reconnecting", () => this.getLogger().info("redis.reconnecting"));
|
|
34
37
|
redis.on("end", () => this.getLogger().info("redis.ended"));
|
|
@@ -37,7 +40,11 @@ export class ConnectionManager {
|
|
|
37
40
|
return redis;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
public setConfiguration(
|
|
43
|
+
public setConfiguration(
|
|
44
|
+
configuration: RedisOptions,
|
|
45
|
+
service: string,
|
|
46
|
+
getLogger: () => ILogger
|
|
47
|
+
) {
|
|
41
48
|
this.redisConfiguration = configuration;
|
|
42
49
|
this.serviceName = service;
|
|
43
50
|
this.getLogger = getLogger;
|