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

 ##########
 File path: 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)
 
 Review comment:
   I know that's the way it was previously,  but that should be `XMLID` because 
XML and ID are both acronyms..

----------------------------------------------------------------
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