@sunnoy/wecom 2.4.0 → 2.4.1
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/package.json +1 -1
- package/wecom/channel-plugin.js +11 -0
package/package.json
CHANGED
package/wecom/channel-plugin.js
CHANGED
|
@@ -625,6 +625,17 @@ export const wecomChannelPlugin = {
|
|
|
625
625
|
setConfigProxyUrl(network.egressProxyUrl ?? "");
|
|
626
626
|
setApiBaseUrl(network.apiBaseUrl ?? "");
|
|
627
627
|
|
|
628
|
+
// Callback-only accounts (Agent API) don't need WS monitor.
|
|
629
|
+
// Return a promise that stays alive until the gateway signals shutdown,
|
|
630
|
+
// so the account is marked as running (not exited → no auto-restart).
|
|
631
|
+
if (!ctx.account.botId && !ctx.account.secret) {
|
|
632
|
+
return new Promise((resolve) => {
|
|
633
|
+
if (ctx.abortSignal) {
|
|
634
|
+
ctx.abortSignal.addEventListener("abort", () => resolve(), { once: true });
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
628
639
|
return startWsMonitor({
|
|
629
640
|
account: ctx.account,
|
|
630
641
|
config: ctx.cfg,
|