@chbo297/infoflow 2026.2.24 → 2026.2.27
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/src/channel.ts +10 -2
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -294,14 +294,22 @@ export const infoflowPlugin: ChannelPlugin<ResolvedInfoflowAccount> = {
|
|
|
294
294
|
abortSignal: ctx.abortSignal,
|
|
295
295
|
statusSink: (patch) => ctx.setStatus({ accountId: account.accountId, ...patch }),
|
|
296
296
|
});
|
|
297
|
-
|
|
297
|
+
|
|
298
|
+
// Keep the channel alive until explicitly stopped.
|
|
299
|
+
// Without this, the promise resolves immediately and the gateway
|
|
300
|
+
// framework treats it as "channel exited", triggering auto-restart.
|
|
301
|
+
try {
|
|
302
|
+
await new Promise<void>((resolve) => {
|
|
303
|
+
ctx.abortSignal.addEventListener("abort", () => resolve(), { once: true });
|
|
304
|
+
});
|
|
305
|
+
} finally {
|
|
298
306
|
unregister?.();
|
|
299
307
|
ctx.setStatus({
|
|
300
308
|
accountId: account.accountId,
|
|
301
309
|
running: false,
|
|
302
310
|
lastStopAt: Date.now(),
|
|
303
311
|
});
|
|
304
|
-
}
|
|
312
|
+
}
|
|
305
313
|
},
|
|
306
314
|
},
|
|
307
315
|
};
|