abler-api 1.0.36 → 1.0.38

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.
@@ -1950,11 +1950,15 @@ let conf$1;
1950
1950
  */
1951
1951
  class commonMessenger$2 {
1952
1952
  static myMsgAddr = "";
1953
- static redisMessenger = RedisMessenger; // 假的,initMessenger 将设置真实的
1953
+ static redisMessenger;
1954
1954
  static onMessage = [];
1955
- static initMessenger(appConfig, appErrCfg, msgChannel) {
1955
+ static async initMessenger(appConfig, appErrCfg, msgChannel) {
1956
1956
  conf$1 = appConfig;
1957
- commonMessenger$2.redisMessenger = conf$1.redis.enabled ? new RedisMessenger(appConfig, appErrCfg, msgChannel).subscribe(msgChannel) : null;
1957
+ // commonMessenger.redisMessenger = conf.redis.enabled ? await RedisMessenger.create(appConfig, appErrCfg, msgChannel).subscribe(msgChannel) : null;
1958
+ // 新的初始化代码(需要在异步环境中执行)
1959
+ if (conf$1.redis.enabled) {
1960
+ commonMessenger$2.redisMessenger = await RedisMessenger.create(appConfig, appErrCfg, msgChannel).then(instance => instance.subscribe(msgChannel));
1961
+ }
1958
1962
  commonMessenger$2.myMsgAddr = commonMessenger$2.getMyMsgAddr();
1959
1963
  }
1960
1964
  static subscribe(channel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",
@@ -15,11 +15,11 @@
15
15
  "author": "peng_peng",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "abler-db": "^1.0.43",
19
- "abler-i18n": "^1.0.2",
20
- "abler-messenger": "^1.0.33",
21
- "abler-net": "^1.0.9",
22
- "abler-util": "^1.0.9",
18
+ "abler-db": "^1.0.44",
19
+ "abler-i18n": "^1.0.3",
20
+ "abler-messenger": "^1.1.1",
21
+ "abler-net": "^1.0.10",
22
+ "abler-util": "^1.0.10",
23
23
  "basic-auth": "^2.0.1",
24
24
  "node-cron": "^3.0.1",
25
25
  "proxy-agent": "6.5.0",
@@ -43,5 +43,5 @@
43
43
  "rollup-plugin-json": "^4.0.0",
44
44
  "rollup-plugin-terser": "^7.0.2"
45
45
  },
46
- "gitHead": "782ad1ef64cc816960475d9e7d1790c055655310"
46
+ "gitHead": "cc2f844911522e28faa0b818a480809dddae6ea9"
47
47
  }