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

events: Clarified return values, proper checks for event plan.

parent 23074aa7
Branches
Tags
No related merge requests found
......@@ -367,7 +367,7 @@ static int event_xfer(zone_t *zone)
/* Sync zonefile immediately if configured. */
if (zone->conf->dbsync_timeout == 0) {
zone_events_schedule(zone, ZONE_EVENT_FLUSH, ZONE_EVENT_NOW);
} else if (zone_events_get_time(zone, ZONE_EVENT_FLUSH) == ZONE_EVENT_NOW) {
} else if (zone_events_get_time(zone, ZONE_EVENT_FLUSH) <= ZONE_EVENT_NOW) {
/* Plan sync if not previously planned. */
zone_events_schedule(zone, ZONE_EVENT_FLUSH, zone->conf->dbsync_timeout);
}
......@@ -611,7 +611,7 @@ static void replan_flush(zone_t *zone, const zone_t *old_zone)
}
const time_t flush_time = zone_events_get_time(old_zone, ZONE_EVENT_FLUSH);
if (flush_time == ZONE_EVENT_NOW) {
if (flush_time <= ZONE_EVENT_NOW) {
// Not scheduled previously.
zone_events_schedule(zone, ZONE_EVENT_FLUSH, zone->conf->dbsync_timeout);
return;
......
......@@ -145,7 +145,8 @@ void zone_events_start(struct zone_t *zone);
* \param type Event type.
*
* \retval time of the event when event found
* \retval negative value if event was not found
* \retval 0 when the event is not planned
* \retval negative value if event is invalid
*/
time_t zone_events_get_time(const struct zone_t *zone, zone_event_type_t type);
......
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