diff options
author | Julien Dessaux | 2021-09-10 17:26:23 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-10 17:26:23 +0200 |
commit | 678fdf8759a7a6ed6628194d085a47b5490e68ea (patch) | |
tree | a335a5db442ad8ba2cc780c5ca17250a68d4f8f1 /internal | |
parent | Added database function to get all train stops (diff) | |
download | trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.tar.gz trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.tar.bz2 trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.zip |
Finished not so simple refactoring
Diffstat (limited to '')
-rw-r--r-- | internal/webui/webui.go | 6 |
1 files changed, 3 insertions, 3 deletions
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()) } |