@@ -33,12 +33,7 @@ import (
3333 "k8s.io/klog"
3434)
3535
36- const (
37- dbDriver = "postgres"
38-
39- connectInterval = 5 * time .Second
40- connectTimeout = 60 * time .Second
41- )
36+ const dbDriver = "postgres"
4237
4338type dbConn struct {
4439 db * sql.DB
@@ -65,7 +60,7 @@ func getDbName() string {
6560}
6661
6762func NewDBInterface () (common.KatibDBInterface , error ) {
68- db , err := common .OpenSQLConn (dbDriver , getDbName (), connectInterval , connectTimeout )
63+ db , err := common .OpenSQLConn (dbDriver , getDbName (), common . ConnectInterval , common . ConnectTimeout )
6964 if err != nil {
7065 return nil , fmt .Errorf ("DB open failed: %v" , err )
7166 }
@@ -160,7 +155,7 @@ func (d *dbConn) GetObservationLog(trialName string, metricName string, startTim
160155 formattedEndTime := e_time .UTC ().Format (time .RFC3339Nano )
161156 qstr += fmt .Sprintf (" AND time <= $%d" , index_of_qparam )
162157 qfield = append (qfield , formattedEndTime )
163- // index_of_qparam += 1
158+ // index_of_qparam += 1 // if any other filters are added, this should be incremented
164159 }
165160
166161 rows , err := d .db .Query (base_stmt + qstr + " ORDER BY time" , qfield ... )
0 commit comments