From dca5a55a8a2c090e0a72c5a74c51082531c996ec Mon Sep 17 00:00:00 2001 From: Andreas Wachter Date: Tue, 27 Feb 2024 07:01:04 +0100 Subject: [PATCH] add cron to all files if necessary (#211) --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 6f3ca93..725c5ea 100644 --- a/main.go +++ b/main.go @@ -563,6 +563,14 @@ func playsForever(c *cron.Cron, conffiles []string, confs []*types.Conf) bool { checkconfigs = append(checkconfigs, readConfigFile(f)...) } + if checkconfigs[0].HasValidCronSpec() { + for num, config := range checkconfigs { + if !config.HasValidCronSpec() { + checkconfigs[num].Cron = checkconfigs[0].Cron + } + } + } + if !cmp.Equal(confs, checkconfigs) { log.Info().Msg("config changed") for _, entry := range c.Entries() {