mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-29 16:54:30 +00:00
perf(gateway): skip idle channel shutdown work
This commit is contained in:
@@ -180,8 +180,12 @@ export function createChannelManager(opts: ChannelManagerOptions): ChannelManage
|
||||
|
||||
const stopChannel = async (channelId: ChannelId, accountId?: string) => {
|
||||
const plugin = getChannelPlugin(channelId);
|
||||
const cfg = loadConfig();
|
||||
const store = getStore(channelId);
|
||||
// Fast path: nothing running and no explicit plugin shutdown hook to run.
|
||||
if (!plugin?.gateway?.stopAccount && store.aborts.size === 0 && store.tasks.size === 0) {
|
||||
return;
|
||||
}
|
||||
const cfg = loadConfig();
|
||||
const knownIds = new Set<string>([
|
||||
...store.aborts.keys(),
|
||||
...store.tasks.keys(),
|
||||
|
||||
Reference in New Issue
Block a user