diff --git a/src/knot/ctl/commands.c b/src/knot/ctl/commands.c index f47413f523a1e90eddcd1349d610ba9c81f3872c..4fdc958ac2baea221576d0d777625c3b19aa0dfc 100644 --- a/src/knot/ctl/commands.c +++ b/src/knot/ctl/commands.c @@ -273,7 +273,10 @@ static int zone_flush(zone_t *zone, ctl_args_t *args) { UNUSED(args); - zone->flags |= ZONE_FORCE_FLUSH; + if (ctl_has_flag(args->data[KNOT_CTL_IDX_FLAGS], CTL_FLAG_FORCE)) { + zone->flags |= ZONE_FORCE_FLUSH; + } + zone_events_schedule(zone, ZONE_EVENT_FLUSH, ZONE_EVENT_NOW); return KNOT_EOK; diff --git a/src/utils/knotc/commands.c b/src/utils/knotc/commands.c index d591a9878a58f8d85ed9e83cae3a97ed7da70cd6..c8245e1a62e07fa6f349f3f7a05fbfab788aa272 100644 --- a/src/utils/knotc/commands.c +++ b/src/utils/knotc/commands.c @@ -325,7 +325,8 @@ static int cmd_ctl(cmd_args_t *args) } knot_ctl_data_t data = { - [KNOT_CTL_IDX_CMD] = ctl_cmd_to_str(args->desc->cmd) + [KNOT_CTL_IDX_CMD] = ctl_cmd_to_str(args->desc->cmd), + [KNOT_CTL_IDX_FLAGS] = args->force ? CTL_FLAG_FORCE : "" }; // Send the command. @@ -488,7 +489,8 @@ static int cmd_zone_memstats(cmd_args_t *args) static int cmd_zone_ctl(cmd_args_t *args) { knot_ctl_data_t data = { - [KNOT_CTL_IDX_CMD] = ctl_cmd_to_str(args->desc->cmd) + [KNOT_CTL_IDX_CMD] = ctl_cmd_to_str(args->desc->cmd), + [KNOT_CTL_IDX_FLAGS] = args->force ? CTL_FLAG_FORCE : "" }; if (args->argc == 0) { @@ -615,7 +617,8 @@ static int cmd_conf_ctl(cmd_args_t *args) } knot_ctl_data_t data = { - [KNOT_CTL_IDX_CMD] = ctl_cmd_to_str(args->desc->cmd) + [KNOT_CTL_IDX_CMD] = ctl_cmd_to_str(args->desc->cmd), + [KNOT_CTL_IDX_FLAGS] = args->force ? CTL_FLAG_FORCE : "" }; // Send the command without parameters.