Skip to content

Commit 44ebc51

Browse files
committed
keep error listeners before quiet in redis
1 parent 0ba38ce commit 44ebc51

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/sim/lib/mcp/pubsub.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,15 @@ class RedisMcpPubSub implements McpPubSubAdapter {
131131
this.toolsChangedHandlers.clear()
132132
this.workflowToolsChangedHandlers.clear()
133133

134+
const noop = () => {}
134135
this.pub.removeAllListeners()
135136
this.sub.removeAllListeners()
137+
this.pub.on('error', noop)
138+
this.sub.on('error', noop)
136139

137-
this.sub.unsubscribe().catch(() => {})
138-
this.pub.quit().catch(() => {})
139-
this.sub.quit().catch(() => {})
140+
this.sub.unsubscribe().catch(noop)
141+
this.pub.quit().catch(noop)
142+
this.sub.quit().catch(noop)
140143
logger.info('Redis MCP pub/sub disposed')
141144
}
142145
}

0 commit comments

Comments
 (0)