diff pkg/controllers/gauges.go @ 4242:1458c9b0fdaa json-handler-middleware

Made the sql.Conn in function accessible via the context of the request.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 22 Aug 2019 10:18:13 +0200
parents 472aedc8927d
children d776110b4db0
line wrap: on
line diff
--- a/pkg/controllers/gauges.go	Thu Aug 22 09:20:38 2019 +0200
+++ b/pkg/controllers/gauges.go	Thu Aug 22 10:18:13 2019 +0200
@@ -577,7 +577,6 @@
 func nashSutcliffe(
 	_ interface{},
 	req *http.Request,
-	conn *sql.Conn,
 ) (jr JSONResult, err error) {
 	gauge := mux.Vars(req)["gauge"]
 
@@ -604,7 +603,7 @@
 
 	var values []observedPredictedValues
 
-	if values, err = loadNashSutcliffeData(ctx, conn, isrs, when); err != nil {
+	if values, err = loadNashSutcliffeData(ctx, JSONConn(req), isrs, when); err != nil {
 		return
 	}