From 74bc32fc2ce8b31ba574895d31a77bf261129230 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Thu, 30 Mar 2023 12:34:18 +0200 Subject: [PATCH] Add env-var and check for periodic-sync --- cmd/app/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/app/main.go b/cmd/app/main.go index aad25af..f74bed9 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -3,6 +3,7 @@ package main import ( "net" "os" + "strconv" envChecks "git.ruekov.eu/ruakij/routingtabletowg/lib/environmentchecks" ip2Map "git.ruekov.eu/ruakij/routingtabletowg/lib/iproute2mapping" @@ -24,6 +25,8 @@ var envDefaults = map[string]string{ "FILTER_PROTOCOL": "-1", "FILTER_TABLE": "-1", + + "PERIODIC_SYNC": "-1", } func main() { @@ -55,6 +58,12 @@ func main() { logger.Error.Fatalf("Couldn't read FILTER_TABLE '%s': %s", filterTableStr, err) } + periodicSyncStr := os.Getenv("PERIODIC_SYNC") + periodicSync, err := strconv.Atoi(periodicSyncStr) + if err != nil { + logger.Error.Fatalf("Couldn't read PERIODIC_SYNC '%s': %s", periodicSyncStr, err) + } + // Create filter filterOptions := FilterOptions{ Table: filterTable,