Generalize Cluster::worker_count.

This commit is contained in:
Jan Grashoefer 2023-04-21 17:13:35 +02:00
parent 379624404c
commit 3db8bb4a44
6 changed files with 62 additions and 47 deletions

View file

@ -32,7 +32,8 @@ redef Log::default_rotation_interval=0sec;
event Cluster::node_up(name: string, id: string)
{
# Insert the data once both workers are connected.
if ( Cluster::local_node_type() == Cluster::MANAGER && Cluster::worker_count == 2 )
if ( Cluster::local_node_type() == Cluster::MANAGER &&
Cluster::get_active_node_count(Cluster::WORKER) == 2 )
{
Intel::insert([$indicator="1.2.3.4", $indicator_type=Intel::ADDR, $meta=[$source="manager"]]);
}