Skip to content
Snippets Groups Projects
Commit e5705641 authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Merge branch 'immediate_sync' of /git/repositories/labs/knot

parents 7ed8d68b 8a7757f8
No related branches found
No related tags found
No related merge requests found
......@@ -817,6 +817,14 @@ static int xfr_task_xfer(xfrworker_t *w, knot_ns_xfr_t *rq)
/* Passed, schedule NOTIFYs. */
zones_schedule_notify(rq->zone);
}
/* Sync zonefile immediately if configured. */
zonedata_t *zone_data = (zonedata_t *)rq->zone->data;
conf_zone_t *zone_conf = zone_data->conf;
if (rq->type == XFR_TYPE_IIN && zone_conf->dbsync_timeout == 0) {
dbg_zones("%s: syncing zone immediately\n", __func__);
zones_schedule_ixfr_sync(rq->zone, 0);
}
/* Update REFRESH/RETRY */
zones_schedule_refresh(rq->zone, REFRESH_DEFAULT);
......
......@@ -664,7 +664,10 @@ static int update_zone(knot_zone_t **dst, conf_zone_t *conf, knot_nameserver_t *
goto fail;
}
zones_schedule_ixfr_sync(new_zone, conf->dbsync_timeout);
/* Don't schedule when immediate syncing is used. */
if (conf->dbsync_timeout > 0) {
zones_schedule_ixfr_sync(new_zone, conf->dbsync_timeout);
}
knot_zone_contents_t *new_contents = new_zone->contents;
if (new_contents) {
......
......@@ -395,11 +395,12 @@ int zones_flush_ev(event_t *e)
/* Reschedule. */
rcu_read_lock();
int next_timeout = zd->conf->dbsync_timeout * 1000;
dbg_zones("zones: next IXFR database SYNC of '%s' in %d seconds\n",
zd->conf->name, next_timeout / 1000);
if (next_timeout > 0) {
dbg_zones("%s: next zonefile sync of '%s' in %d seconds\n",
__func__, zd->conf->name, next_timeout / 1000);
evsched_schedule(e->parent, e, next_timeout);
}
rcu_read_unlock();
evsched_schedule(e->parent, e, next_timeout);
return ret;
}
......@@ -1327,6 +1328,14 @@ static int zones_process_update_auth(knot_zone_t *zone,
free(msg);
msg = NULL;
/* Sync zonefile immediately if configured. */
zonedata_t *zone_data = (zonedata_t *)zone->data;
int sync_timeout = zone_data->conf->dbsync_timeout;
if (sync_timeout == 0) {
dbg_zones("%s: syncing zone immediately\n", __func__);
zones_schedule_ixfr_sync(zone, 0);
}
// Prepare DDNS response.
assert(*rcode == KNOT_RCODE_NOERROR);
dbg_zones_verb("Preparing NOERROR UPDATE response RCODE=%u "
......
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