diff --git a/cmd/ingestd/main.go b/cmd/ingestd/main.go index 464f569..8f61d20 100644 --- a/cmd/ingestd/main.go +++ b/cmd/ingestd/main.go @@ -46,6 +46,9 @@ func main() { log.Fatalf("site timezone load: %v", err) } rainDayLoc = loc + log.Printf("site timezone configured: %s", cfg.Site.Timezone) + } else { + log.Printf("site timezone not set; falling back to process local timezone: %s", time.Local) } log.Printf("rain day timezone: %s", rainDayLoc) diff --git a/internal/config/config.go b/internal/config/config.go index 2dd8771..1e13707 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -107,6 +107,9 @@ func Load(path string) (*Config, error) { if c.Site.Name == "" { c.Site.Name = "default" } + if c.Wunderground.Enabled && c.Site.Timezone == "" { + return nil, errors.New("site timezone is required when wunderground is enabled (used for daily rain boundary)") + } if c.Site.Timezone != "" { if _, err := time.LoadLocation(c.Site.Timezone); err != nil { return nil, fmt.Errorf("invalid site timezone %q: %w", c.Site.Timezone, err)