abler-api 0.1.80 → 0.1.81
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.
- package/dist/cjs/pp-util.js +8 -1
- package/package.json +1 -1
package/dist/cjs/pp-util.js
CHANGED
|
@@ -1700,6 +1700,12 @@ class commonMessenger$2 {
|
|
|
1700
1700
|
commonMessenger$2.redisMessenger = conf$1.redis.enabled ? new RedisMessenger(appConfig, appErrCfg, msgChannel).subscribe(msgChannel) : null;
|
|
1701
1701
|
commonMessenger$2.myMsgAddr = commonMessenger$2.getMyMsgAddr();
|
|
1702
1702
|
}
|
|
1703
|
+
static subscribe(channel) {
|
|
1704
|
+
if (commonMessenger$2.redisMessenger) {
|
|
1705
|
+
commonMessenger$2.redisMessenger.subscribe(channel);
|
|
1706
|
+
}
|
|
1707
|
+
return commonMessenger$2;
|
|
1708
|
+
}
|
|
1703
1709
|
static getMyMsgAddr() {
|
|
1704
1710
|
if (!conf$1.myMsgAddr) {
|
|
1705
1711
|
conf$1.pm_id = process.env.pm_id || "0";
|
|
@@ -1723,7 +1729,7 @@ class commonMessenger$2 {
|
|
|
1723
1729
|
}
|
|
1724
1730
|
static async publishMessage(message, msgChannel) {
|
|
1725
1731
|
if (commonMessenger$2.redisMessenger) {
|
|
1726
|
-
|
|
1732
|
+
commonMessenger$2.redisMessenger.publish(message, msgChannel);
|
|
1727
1733
|
} else {
|
|
1728
1734
|
//没有消息处理器,则将消息转发到目标地址(不支持pm2多进程)
|
|
1729
1735
|
if (message.destAddr) {
|
|
@@ -1737,6 +1743,7 @@ class commonMessenger$2 {
|
|
|
1737
1743
|
}
|
|
1738
1744
|
}
|
|
1739
1745
|
}
|
|
1746
|
+
return commonMessenger$2;
|
|
1740
1747
|
}
|
|
1741
1748
|
static async handleInternalMessage(options) {
|
|
1742
1749
|
const message = options.replacements;
|