Skip to content
Snippets Groups Projects
Commit 3d4632c9 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'expire_changes' into 'master'

Zone expiration improvements

See merge request !1470
parents e2de36eb 0fccd0f5
Branches
Tags
1 merge request!1470Zone expiration improvements
Pipeline #101350 passed with stages
in 10 minutes and 6 seconds
/* Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -38,8 +38,8 @@ int event_expire(conf_t *conf, zone_t *zone)
zone->zonefile.exists = false;
// NOTE: must preserve zone->timers.soa_expire
zone->timers.next_refresh = time(NULL);
zone->timers.next_expire = time(NULL);
zone->timers.next_refresh = zone->timers.next_expire;
replan_from_timers(conf, zone);
return KNOT_EOK;
......
......@@ -278,7 +278,9 @@ int selective_zone_purge(conf_t *conf, zone_t *zone, purge_flag_t params)
// Purge the zone timers.
if (params & PURGE_ZONE_TIMERS) {
memset(&zone->timers, 0, sizeof(zone->timers));
zone->timers = (zone_timers_t) {
.catalog_member = zone->timers.catalog_member
};
ret = zone_timers_sweep(&zone->server->timerdb,
(sweep_cb)knot_dname_cmp, zone->name);
RETURN_IF_FAILED("timers", KNOT_ENOENT);
......@@ -314,6 +316,7 @@ int selective_zone_purge(conf_t *conf, zone_t *zone, purge_flag_t params)
// Purge Catalog.
if (params & PURGE_ZONE_CATALOG) {
zone->timers.catalog_member = 0;
ret = catalog_zone_purge(zone->server, conf, zone->name);
RETURN_IF_FAILED("catalog", KNOT_EOK);
}
......
......@@ -251,7 +251,8 @@ static void zone_purge(conf_t *conf, zone_t *zone)
static zone_contents_t *zone_expire(zone_t *zone)
{
zone->timers.next_refresh = time(NULL);
zone->timers.next_expire = time(NULL);
zone->timers.next_refresh = zone->timers.next_expire;
return zone_switch_contents(zone, NULL);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment