mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
checkpoint: File edit:
🚀 Generated with [Claude Code](https://claude.com/claude-code) 📊 V3 Development Progress Checkpoint Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1ae74fc0c
commit
2a0089c247
1 file changed
+11
-6
@@ -332,16 +332,21 @@ export class FederationHub extends EventEmitter {
|
||||
clearInterval(this.cleanupInterval);
|
||||
}
|
||||
|
||||
// Terminate all ephemeral agents
|
||||
for (const agent of this.ephemeralAgents.values()) {
|
||||
if (agent.status === 'active' || agent.status === 'spawning') {
|
||||
await this.terminateAgent(agent.id);
|
||||
}
|
||||
}
|
||||
// Terminate all active ephemeral agents using index - O(k) where k = active + spawning
|
||||
const activeIds = this.getAgentIdsByStatus('active');
|
||||
const spawningIds = this.getAgentIdsByStatus('spawning');
|
||||
const toTerminate = [...activeIds, ...spawningIds];
|
||||
|
||||
await Promise.all(toTerminate.map(id => this.terminateAgent(id)));
|
||||
|
||||
// Clear all data structures and indexes
|
||||
this.swarms.clear();
|
||||
this.ephemeralAgents.clear();
|
||||
this.proposals.clear();
|
||||
this.agentsBySwarm.clear();
|
||||
for (const status of this.agentsByStatus.values()) {
|
||||
status.clear();
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
|
||||
Reference in new issue
Block a user