0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00

Create event to run ORTC algorithm exactly once

This commit is contained in:
Igor Putovny 2023-11-21 12:58:24 +01:00
parent 2b6cfd2065
commit 299f9e80f7
2 changed files with 9 additions and 0 deletions

View File

@ -1178,6 +1178,7 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new
}
HASH_WALK_END;
ev_schedule(&p->reload_trie);
/* Announce changes */
if (old_bucket)
@ -1275,6 +1276,11 @@ aggregator_start(struct proto *P)
p->trie_slab = sl_new(p->p.pool, sizeof(struct trie_node));
p->root = new_node(p->trie_slab);
p->reload_trie = (event) {
.hook = calculate_trie,
.data = p,
};
return PS_UP;
}
@ -1301,6 +1307,7 @@ aggregator_shutdown(struct proto *P)
}
HASH_WALK_END;
ev_postpone(&p->reload_trie);
delete_trie(p->root);
p->root = NULL;

View File

@ -67,6 +67,8 @@ struct aggregator_proto {
/* Aggregation trie */
slab *trie_slab;
struct trie_node *root;
struct event reload_trie;
};
enum aggr_item_type {