perf(gateway): skip idle channel shutdown work
This commit is contained in:
parent
a0cbf9002d
commit
3a73e2508b
@ -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(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user