mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 05:52:45 +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 stopChannel = async (channelId: ChannelId, accountId?: string) => {
|
||||||
const plugin = getChannelPlugin(channelId);
|
const plugin = getChannelPlugin(channelId);
|
||||||
const cfg = loadConfig();
|
|
||||||
const store = getStore(channelId);
|
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>([
|
const knownIds = new Set<string>([
|
||||||
...store.aborts.keys(),
|
...store.aborts.keys(),
|
||||||
...store.tasks.keys(),
|
...store.tasks.keys(),
|
||||||
|
|||||||
Reference in New Issue
Block a user