mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-14 15:18:44 +00:00
Create event to run ORTC algorithm exactly once
This commit is contained in:
parent
54491f9606
commit
b574c62d57
@ -1178,6 +1178,7 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new
|
|||||||
}
|
}
|
||||||
HASH_WALK_END;
|
HASH_WALK_END;
|
||||||
|
|
||||||
|
ev_schedule(&p->reload_trie);
|
||||||
|
|
||||||
/* Announce changes */
|
/* Announce changes */
|
||||||
if (old_bucket)
|
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->trie_slab = sl_new(p->p.pool, sizeof(struct trie_node));
|
||||||
p->root = new_node(p->trie_slab);
|
p->root = new_node(p->trie_slab);
|
||||||
|
|
||||||
|
p->reload_trie = (event) {
|
||||||
|
.hook = calculate_trie,
|
||||||
|
.data = p,
|
||||||
|
};
|
||||||
|
|
||||||
return PS_UP;
|
return PS_UP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1301,6 +1307,7 @@ aggregator_shutdown(struct proto *P)
|
|||||||
}
|
}
|
||||||
HASH_WALK_END;
|
HASH_WALK_END;
|
||||||
|
|
||||||
|
ev_postpone(&p->reload_trie);
|
||||||
delete_trie(p->root);
|
delete_trie(p->root);
|
||||||
p->root = NULL;
|
p->root = NULL;
|
||||||
|
|
||||||
|
@ -67,6 +67,8 @@ struct aggregator_proto {
|
|||||||
/* Aggregation trie */
|
/* Aggregation trie */
|
||||||
slab *trie_slab;
|
slab *trie_slab;
|
||||||
struct trie_node *root;
|
struct trie_node *root;
|
||||||
|
|
||||||
|
struct event reload_trie;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum aggr_item_type {
|
enum aggr_item_type {
|
||||||
|
Loading…
Reference in New Issue
Block a user