UTC bugfix again
This commit is contained in:
@@ -46,6 +46,9 @@ func main() {
|
|||||||
log.Fatalf("site timezone load: %v", err)
|
log.Fatalf("site timezone load: %v", err)
|
||||||
}
|
}
|
||||||
rainDayLoc = loc
|
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)
|
log.Printf("rain day timezone: %s", rainDayLoc)
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ func Load(path string) (*Config, error) {
|
|||||||
if c.Site.Name == "" {
|
if c.Site.Name == "" {
|
||||||
c.Site.Name = "default"
|
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 c.Site.Timezone != "" {
|
||||||
if _, err := time.LoadLocation(c.Site.Timezone); err != nil {
|
if _, err := time.LoadLocation(c.Site.Timezone); err != nil {
|
||||||
return nil, fmt.Errorf("invalid site timezone %q: %w", c.Site.Timezone, err)
|
return nil, fmt.Errorf("invalid site timezone %q: %w", c.Site.Timezone, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user