diff --git a/cmd/alice-lg/banner.go b/cmd/alice-lg/banner.go index ee1b16f..fdc5c68 100644 --- a/cmd/alice-lg/banner.go +++ b/cmd/alice-lg/banner.go @@ -32,7 +32,7 @@ var banner = []string{ func printBanner( cfg *config.Config, - neigborsStore *store.NeighborsStore, + neighborsStore *store.NeighborsStore, routesStore *store.RoutesStore, ) { status, _ := http.CollectAppStatus(routesStore, neighborsStore) diff --git a/cmd/alice-lg/main.go b/cmd/alice-lg/main.go index 42e8965..92aa2dc 100644 --- a/cmd/alice-lg/main.go +++ b/cmd/alice-lg/main.go @@ -23,23 +23,23 @@ func main() { flag.Parse() // Load configuration - cfg, err = config.LoadConfig(filename) + cfg, err := config.LoadConfig(*configFilenameFlag) if err != nil { log.Fatal(err) } - // Say hi - printBanner(cfg) - log.Println("Using configuration:", cfg.File) - // Setup local routes store neighborsStore := store.NewNeighborsStore(cfg) - routesStore := store.NewRoutesStore(cfg) + routesStore := store.NewRoutesStore(neighborsStore, cfg) + + // Say hi + printBanner(cfg, neighborsStore, routesStore) + log.Println("Using configuration:", cfg.File) // Start stores - if config.EnablePrefixLookup == true { - go neighborsStore.Start(ctx) - go routesStore.Start(ctx) + if cfg.Server.EnablePrefixLookup == true { + go neighborsStore.Start() + go routesStore.Start() } // Start the Housekeeping diff --git a/pkg/store/routes_store.go b/pkg/store/routes_store.go index 970be60..2015a80 100644 --- a/pkg/store/routes_store.go +++ b/pkg/store/routes_store.go @@ -1,7 +1,6 @@ package store import ( - "context" "log" "strings" "sync" @@ -66,7 +65,7 @@ func NewRoutesStore( } // Start starts the routes store -func (rs *RoutesStore) Start(ctx context.Context) { +func (rs *RoutesStore) Start() { log.Println("Starting local routes store") log.Println("Routes Store refresh interval set to:", rs.refreshInterval) if err := rs.init(); err != nil {