improve performace?

This commit is contained in:
2025-06-12 20:50:46 -05:00
parent a8e61cdbaa
commit 86cd5f2472
2 changed files with 48 additions and 49 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"os"
"regexp"
"time"
"gitlab.smoothnet.org/nhyatt/bind-response-policy-zone-creator/internal/config"
@ -21,6 +22,15 @@ func main() {
os.Exit(1)
}
// test allow regex
for _, allowedItem := range cfg.ConfigFile.AllowLists {
_, err := regexp.Compile(allowedItem)
if err != nil {
log.Error("unable to parse allow list item", "error", err, "regex", allowedItem)
os.Exit(1)
}
}
// Set the zone serial number
cfg.ConfigFile.ZoneConfig.Serial = time.Now().In(cfg.TZLocal).Format("0601021504")