Browse Source

More funcs logs

Volodymyr Tkach 2 years ago
parent
commit
551724d516
1 changed files with 6 additions and 0 deletions
  1. 6 0
      gosql/common/dbmethods.go

+ 6 - 0
gosql/common/dbmethods.go

@@ -98,15 +98,21 @@ func (d *DBMethods) QueryRow(ctx context.Context, query string, args ...any) *Ro
 }
 }
 
 
 func (d *DBMethods) SetConnMaxLifetime(t time.Duration) {
 func (d *DBMethods) SetConnMaxLifetime(t time.Duration) {
+	start := time.Now()
 	d.DB.SetConnMaxLifetime(t)
 	d.DB.SetConnMaxLifetime(t)
+	d.log("SetConnMaxLifetime", start, nil, false, "")
 }
 }
 
 
 func (d *DBMethods) SetMaxIdleConns(n int) {
 func (d *DBMethods) SetMaxIdleConns(n int) {
+	start := time.Now()
 	d.DB.SetMaxIdleConns(n)
 	d.DB.SetMaxIdleConns(n)
+	d.log("SetMaxIdleConns", start, nil, false, "")
 }
 }
 
 
 func (d *DBMethods) SetMaxOpenConns(n int) {
 func (d *DBMethods) SetMaxOpenConns(n int) {
+	start := time.Now()
 	d.DB.SetMaxOpenConns(n)
 	d.DB.SetMaxOpenConns(n)
+	d.log("SetMaxOpenConns", start, nil, false, "")
 }
 }
 
 
 func (d *DBMethods) Transaction(ctx context.Context, callback func(ctx context.Context, tx *Tx) error) error {
 func (d *DBMethods) Transaction(ctx context.Context, callback func(ctx context.Context, tx *Tx) error) error {