aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJulien Dessaux2021-09-10 17:26:23 +0200
committerJulien Dessaux2021-09-10 17:26:23 +0200
commit678fdf8759a7a6ed6628194d085a47b5490e68ea (patch)
treea335a5db442ad8ba2cc780c5ca17250a68d4f8f1 /internal
parentAdded database function to get all train stops (diff)
downloadtrains-678fdf8759a7a6ed6628194d085a47b5490e68ea.tar.gz
trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.tar.bz2
trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.zip
Finished not so simple refactoring
Diffstat (limited to '')
-rw-r--r--internal/webui/webui.go6
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())
}