Skip to content

Commit d8bcc59

Browse files
committed
fix: merge only if the scheduler_cron_time exists in the agent_controller_agent_config_t and rename cron_time to prev_cron_time
1 parent adba316 commit d8bcc59

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

agent_controller/agent_controller.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,15 @@ dup_str_ptr_array (const GPtrArray *src)
521521
*
522522
* @param[in] agent Agent providing the base configuration.
523523
* @param[in] update_cfg Optional configuration overrides. May be NULL.
524-
* @param[in] cron_time Optional old cron time to remove. May be NULL.
524+
* @param[in] prev_cron_time Optional old cron time to remove. May be NULL.
525525
*
526526
* @return Newly allocated merged configuration on success,
527527
* or NULL on error.
528528
*/
529529
static agent_controller_agent_config_t
530530
agent_controller_build_agent_config_with_defaults (
531531
const agent_controller_agent_t agent,
532-
const agent_controller_agent_config_t update_cfg, const gchar *cron_time)
532+
const agent_controller_agent_config_t update_cfg, const gchar *prev_cron_time)
533533
{
534534
if (!agent || !agent->config)
535535
return NULL;
@@ -582,12 +582,13 @@ agent_controller_build_agent_config_with_defaults (
582582
agent->config->agent_script_executor.indexer_dir_depth;
583583
}
584584

585-
if (update_cfg)
585+
if (update_cfg && update_cfg->agent_script_executor.scheduler_cron_time)
586586
{
587587
merged->agent_script_executor.scheduler_cron_time =
588588
dup_str_ptr_array_merge_crons (
589589
agent->config->agent_script_executor.scheduler_cron_time,
590-
update_cfg->agent_script_executor.scheduler_cron_time, cron_time);
590+
update_cfg->agent_script_executor.scheduler_cron_time,
591+
prev_cron_time);
591592
}
592593
else
593594
{

0 commit comments

Comments
 (0)