chore: refactoring and docs

This commit is contained in:
2025-08-21 18:00:02 +02:00
parent 5870695465
commit 1738017fd5
8 changed files with 51 additions and 37 deletions

View File

@@ -2,7 +2,7 @@
ClusterManager::ClusterManager(NodeContext& ctx) : ctx(ctx) {
// Register callback for node_discovered event
ctx.registerEvent("node_discovered", [this](void* data) {
ctx.on("node_discovered", [this](void* data) {
NodeInfo* node = static_cast<NodeInfo*>(data);
this->addOrUpdateNode(node->hostname, node->ip);
});
@@ -111,7 +111,7 @@ void ClusterManager::heartbeatTaskCallback() {
node.lastSeen = millis();
node.status = NodeInfo::ACTIVE;
updateLocalNodeResources();
ctx.triggerEvent("node_discovered", &node);
ctx.fire("node_discovered", &node);
break;
}
}