From 75e007603f7a4fff55b8b3cb6a9e2e55f8654810 Mon Sep 17 00:00:00 2001 From: pigwin Date: Sat, 4 Jan 2025 20:57:01 +0000 Subject: [PATCH] chat gpt pls dp me help, yess --- export/database.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/export/database.go b/export/database.go index 4b798b9..94758b0 100644 --- a/export/database.go +++ b/export/database.go @@ -169,7 +169,12 @@ func DBData(data *data.Data) { otherJson = string(jsonString) values = append(values, otherJson) - jobs <- values + // Insert or update the record and get the id + id, action, err := database.InsertOrUpdateEstimatedVehicleJourney(db, values) + if err != nil { + fmt.Printf("Error inserting/updating estimated vehicle journey: %v\n", err) + continue + } // Add the missing code here for _, estimatedCall := range journey.EstimatedCalls {