From 5fd16ff73c24a6d1d0a1779cc159b75f0adb0cb8 Mon Sep 17 00:00:00 2001 From: Peder Vatn Austad Date: Thu, 26 Dec 2024 19:38:28 +0100 Subject: [PATCH] imma call it a night --- README.md | 1 + config/db.go | 11 +++++------ data/data.go | 2 +- database/EstimatedCall.go | 2 +- export/database.go | 8 ++++++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 976d5e6..57a5d12 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ The best thing to happen since yesturday at 3 pm | Version | Changes | |-----------|----------------------| +| 0.3 | it works as i want it to now (i think) now its time for a shiton of trubleshooting (yay!) | | 0.2 | split the project into multiple files to make it more readable | | 0.1.1-7 | fixing the json print output to actualy print out all the data and sutch | | 0.1 | literaly most of the project | diff --git a/config/db.go b/config/db.go index c43b004..0e553bd 100644 --- a/config/db.go +++ b/config/db.go @@ -48,10 +48,9 @@ func PrintDBConfig() { return } - fmt.Println("Configuration:", config) - fmt.Println("Host:", config.Database.Host) - fmt.Println("Port:", config.Database.Port) - fmt.Println("User:", config.Database.User) - fmt.Println("Database Host:", config.Database.Host) - fmt.Println("Database Password:", config.Database.Password) + //fmt.Println("Configuration:", config) + //fmt.Println("Host:", config.Database.Host) + //fmt.Println("Port:", config.Database.Port) + fmt.Println("Database User:", config.Database.User) + //fmt.Println("Database Password:", config.Database.Password) } diff --git a/data/data.go b/data/data.go index 1d162d6..b8ad6f5 100644 --- a/data/data.go +++ b/data/data.go @@ -169,7 +169,7 @@ func FetchData() (*Data, error) { }, } - resp, err := client.Get("https://api.entur.io/realtime/v1/rest/et?useOriginalId=true&maxSize=10") + resp, err := client.Get("https://api.entur.io/realtime/v1/rest/et?useOriginalId=true&maxSize=100000&requestorId=ti1ASDASDDAAWdfs") if err != nil { return nil, err } diff --git a/database/EstimatedCall.go b/database/EstimatedCall.go index ac7cf3b..f6d0797 100644 --- a/database/EstimatedCall.go +++ b/database/EstimatedCall.go @@ -42,7 +42,7 @@ func InsertOrUpdateEstimatedCall(db *sql.DB, values []interface{}) (int, string, var id int err = stmt.QueryRow(values...).Scan(&action, &id) if err != nil { - if 1 == 0 { + if 1 == 1 { fmt.Println("Executing query:", query) for i, v := range values { fmt.Printf("Value %d: (%v)\n", i+1, v) diff --git a/export/database.go b/export/database.go index 735c779..2b76dee 100644 --- a/export/database.go +++ b/export/database.go @@ -140,7 +140,9 @@ func DBData(data *data.Data) { if err != nil { fmt.Printf("Error inserting/updating estimated vehicle journey: %v\n", err) } else { - fmt.Printf("Action: %s, ID: %d\n", action, id) + if 1 == 0 { + fmt.Printf("Action: %s, ID: %d\n", action, id) + } } for _, estimatedCall := range journey.EstimatedCalls { for _, call := range estimatedCall.EstimatedCall { @@ -266,7 +268,9 @@ func DBData(data *data.Data) { if err != nil { fmt.Printf("Error inserting/updating estimated call: %v\n", err) } else { - fmt.Printf("Action: %s, ID: %d\n", action, id) + if 1 == 0 { + fmt.Printf("Action: %s, ID: %d\n", action, id) + } } } }