From 678fdf8759a7a6ed6628194d085a47b5490e68ea Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 10 Sep 2021 17:26:23 +0200 Subject: Finished not so simple refactoring --- internal/webui/webui.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/webui') diff --git a/internal/webui/webui.go b/internal/webui/webui.go index fa59f68..b18bc5c 100644 --- a/internal/webui/webui.go +++ b/internal/webui/webui.go @@ -21,9 +21,9 @@ func Run(c *config.Config, dbEnv *database.DBEnv) { if i, err := dbEnv.CountStops(); err == nil && i == 0 { log.Printf("No trains stops data found, updating...") - if trainStops, err := e.navitia.GetStops(); err == nil { - log.Printf("Updated trains stops data from navitia api, got %d results", len(trainStops)) - if err = dbEnv.ReplaceAndImportStops(trainStops); err != nil { + if stops, err := e.navitia.GetStops(); err == nil { + log.Printf("Updated trains stops data from navitia api, got %d results", len(stops)) + if err = dbEnv.ReplaceAndImportStops(stops); err != nil { if dberr, ok := err.(*database.QueryError); ok { log.Printf("%+v", dberr.Unwrap()) } -- cgit v1.2.3