Add small jitter to keyexpire_handle and edgeupdate_handler
This commit is contained in:
parent
d172f2db29
commit
837469c747
1 changed files with 2 additions and 2 deletions
|
@ -311,12 +311,12 @@ static timeout_t edgeupdate_timeout;
|
|||
|
||||
static void keyexpire_handler(void *data) {
|
||||
regenerate_key();
|
||||
timeout_set(data, &(struct timeval){keylifetime, rand() % 100000});
|
||||
timeout_set(data, &(struct timeval){keylifetime + (rand() % 10), rand() % 100000});
|
||||
}
|
||||
|
||||
static void edgeupdate_handler(void *data) {
|
||||
update_edge_weight();
|
||||
timeout_set(data, &(struct timeval){edgeupdateinterval, rand() % 100000});
|
||||
timeout_set(data, &(struct timeval){edgeupdateinterval + (rand() % 10), rand() % 100000});
|
||||
}
|
||||
|
||||
void regenerate_key(void) {
|
||||
|
|
Loading…
Reference in a new issue