gotta fix that valkey shit later
This commit is contained in:
@@ -35,6 +35,14 @@ func InsertOrUpdateEstimatedCall(ctx context.Context, db *sql.DB, values []inter
|
|||||||
key := fmt.Sprintf("%v.%v", estimatedVehicleJourneyID, orderID)
|
key := fmt.Sprintf("%v.%v", estimatedVehicleJourneyID, orderID)
|
||||||
fmt.Printf("Estimated Vehicle Journey ID: %v, Order ID: %v\n", estimatedVehicleJourneyID, orderID)
|
fmt.Printf("Estimated Vehicle Journey ID: %v, Order ID: %v\n", estimatedVehicleJourneyID, orderID)
|
||||||
|
|
||||||
|
var err error
|
||||||
|
|
||||||
|
// Set the MD5 hash in Valkey
|
||||||
|
err = valki.SetValkeyValue(ctx, valkeyClient, key, hashString)
|
||||||
|
if err != nil {
|
||||||
|
return 0, "", fmt.Errorf("failed to set value in Valkey: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Get the MD5 hash from Valkey
|
// Get the MD5 hash from Valkey
|
||||||
retrievedHash, err := valki.GetValkeyValue(ctx, valkeyClient, key)
|
retrievedHash, err := valki.GetValkeyValue(ctx, valkeyClient, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -47,12 +55,6 @@ func InsertOrUpdateEstimatedCall(ctx context.Context, db *sql.DB, values []inter
|
|||||||
}
|
}
|
||||||
fmt.Println("Retrieved hash matches the original hash.")
|
fmt.Println("Retrieved hash matches the original hash.")
|
||||||
|
|
||||||
// Set the MD5 hash in Valkey
|
|
||||||
err = valki.SetValkeyValue(ctx, valkeyClient, key, hashString)
|
|
||||||
if err != nil {
|
|
||||||
return 0, "", fmt.Errorf("failed to set value in Valkey: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
query := `
|
query := `
|
||||||
INSERT INTO calls (
|
INSERT INTO calls (
|
||||||
estimatedvehiclejourney, "order", stoppointref,
|
estimatedvehiclejourney, "order", stoppointref,
|
||||||
|
|||||||
Reference in New Issue
Block a user