ndr: close existing bus before restart to prevent duplicate listeners

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Iris Deploy 2026-01-28 11:43:54 +01:00
parent 01e03d8938
commit cdba4f6791

View File

@ -184,6 +184,14 @@ export const ndrPlugin: ChannelPlugin<ResolvedNdrAccount> = {
});
ctx.log?.info(`[${account.accountId}] starting NDR provider`);
// Close existing bus if any (prevents duplicate listeners on restart)
const existingBus = activeBuses.get(account.accountId);
if (existingBus) {
ctx.log?.info(`[${account.accountId}] closing existing NDR bus before restart`);
existingBus.close();
activeBuses.delete(account.accountId);
}
const runtime = getNdrRuntime();
const bus = await startNdrBus({