Skip to content
Snippets Groups Projects
Commit b0785d12 authored by Libor Peltan's avatar Libor Peltan Committed by Daniel Salzman
Browse files

events/refresh: minimum timeout for next refresh

parent 891bc52a
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,7 @@
#define BOOTSTRAP_MAXTIME (24*60*60)
#define BOOTSTRAP_JITTER (30)
#define NEXT_REFRESH_MIN (2)
enum state {
REFRESH_STATE_INVALID = 0,
......@@ -917,6 +918,11 @@ int event_refresh(conf_t *conf, zone_t *zone)
zone->timers.next_refresh = now + next;
}
/* Security: avoid flooding master. */
if (zone->timers.next_refresh < now + NEXT_REFRESH_MIN) {
zone->timers.next_refresh = now + NEXT_REFRESH_MIN;
}
/* Rechedule events. */
replan_from_timers(conf, zone);
if (updated) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment