mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 14:16:34 +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
3f36886b06
commit
12fe4da63a
1 file changed
+8
-3
@@ -463,13 +463,18 @@ export class TopologyManager extends EventEmitter implements ITopologyManager {
|
||||
}
|
||||
|
||||
private async rebalanceHierarchical(): Promise<void> {
|
||||
const queen = this.state.nodes.find(n => n.role === 'queen');
|
||||
// O(1) queen lookup
|
||||
let queen = this.queenNode;
|
||||
if (!queen) {
|
||||
// Elect a queen if missing
|
||||
if (this.state.nodes.length > 0) {
|
||||
this.state.nodes[0].role = 'queen';
|
||||
const newQueen = this.state.nodes[0]!;
|
||||
newQueen.role = 'queen';
|
||||
this.addToRoleIndex(newQueen);
|
||||
queen = newQueen;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure all workers are connected to queen
|
||||
|
||||
Reference in new issue
Block a user