dangogh closed pull request #1804: prepared transactions from within a handler 
create a connections leak to postgres
URL: https://github.com/apache/incubator-trafficcontrol/pull/1804
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/traffic_ops_golang/tenant/tenancy.go 
b/traffic_ops/traffic_ops_golang/tenant/tenancy.go
index 0a71ef0e68..13a8899280 100644
--- a/traffic_ops/traffic_ops_golang/tenant/tenancy.go
+++ b/traffic_ops/traffic_ops_golang/tenant/tenancy.go
@@ -45,13 +45,9 @@ func (dsInfo DeliveryServiceTenantInfo) 
IsTenantAuthorized(user auth.CurrentUser
 // returns tenant information for a deliveryservice
 func GetDeliveryServiceTenantInfo(xmlId string, db *sqlx.DB) 
(*DeliveryServiceTenantInfo, error) {
        ds := DeliveryServiceTenantInfo{}
-       tenantInfoStmt, err := db.Preparex("SELECT xml_id,tenant_id FROM 
deliveryservice where xml_id = $1")
-       if err != nil {
-               log.Errorf("deliveryservice sql query error, xmlId '%s': %v\n", 
xmlId, err)
-               return nil, err
-       }
+       query := "SELECT xml_id,tenant_id FROM deliveryservice where xml_id = 
$1"
 
-       err = tenantInfoStmt.Get(&ds, xmlId)
+       err := db.Get(&ds,query,xmlId)
        switch {
        case err == sql.ErrNoRows:
                ds = DeliveryServiceTenantInfo{}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to