Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for maxLifetime (0.23 sec)

  1. src/database/sql/sql.go

    		return 0
    	default:
    		return n
    	}
    }
    
    func (db *DB) shortestIdleTimeLocked() time.Duration {
    	if db.maxIdleTime <= 0 {
    		return db.maxLifetime
    	}
    	if db.maxLifetime <= 0 {
    		return db.maxIdleTime
    	}
    	return min(db.maxIdleTime, db.maxLifetime)
    }
    
    // SetMaxIdleConns sets the maximum number of connections in the idle
    // connection pool.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 103.6K bytes
    - Viewed (0)
  2. src/database/sql/sql_test.go

    			int64(usedConns - reusedConns),
    			10 * time.Millisecond,
    			0,
    		},
    		{
    			// Want to close some connections via max idle time and one by max lifetime.
    			time.Millisecond,
    			// nowFunc() - MaxLifetime should be 1 * time.Nanosecond in connectionCleanerRunLocked.
    			// This guarantees that first opened connection is to be closed.
    			// Thus it is timeOffset + secondTimeOffset + 3 (+2 for Close while reusing conns and +1 for Conn).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 111.6K bytes
    - Viewed (0)
Back to top