diff pkg/controllers/diff.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 cb4fda122321
children d776110b4db0
line wrap: on
line diff
--- a/pkg/controllers/diff.go	Thu Aug 22 09:20:38 2019 +0200
+++ b/pkg/controllers/diff.go	Thu Aug 22 10:18:13 2019 +0200
@@ -87,7 +87,6 @@
 func diffCalculation(
 	input interface{},
 	req *http.Request,
-	conn *sql.Conn,
 ) (jr JSONResult, err error) {
 
 	begin := time.Now()
@@ -97,6 +96,8 @@
 
 	ctx := req.Context()
 
+	conn := JSONConn(req)
+
 	var id int64
 	err = conn.QueryRowContext(
 		ctx,