Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for SetConnMaxLifetime (0.3 sec)

  1. src/database/sql/example_cli_test.go

    	if err != nil {
    		// This will not be a connection error, but a DSN parse error or
    		// another initialization error.
    		log.Fatal("unable to use data source name", err)
    	}
    	defer pool.Close()
    
    	pool.SetConnMaxLifetime(0)
    	pool.SetMaxIdleConns(3)
    	pool.SetMaxOpenConns(3)
    
    	ctx, stop := context.WithCancel(context.Background())
    	defer stop()
    
    	appSignal := make(chan os.Signal, 3)
    	signal.Notify(appSignal, os.Interrupt)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 08 17:27:54 UTC 2022
    - 2K bytes
    - Viewed (0)
  2. src/database/sql/example_service_test.go

    	db, err := sql.Open("driver-name", "database=test1")
    	if err != nil {
    		// This will not be a connection error, but a DSN parse error or
    		// another initialization error.
    		log.Fatal(err)
    	}
    	db.SetConnMaxLifetime(0)
    	db.SetMaxIdleConns(50)
    	db.SetMaxOpenConns(50)
    
    	s := &Service{db: db}
    
    	http.ListenAndServe(":8080", s)
    }
    
    type Service struct {
    	db *sql.DB
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 28 20:21:26 UTC 2024
    - 4K bytes
    - Viewed (0)
  3. api/go1.6.txt

    pkg crypto/x509, method (InsecureAlgorithmError) Error() string
    pkg crypto/x509, method (SignatureAlgorithm) String() string
    pkg crypto/x509, type InsecureAlgorithmError int
    pkg database/sql, method (*DB) SetConnMaxLifetime(time.Duration)
    pkg debug/dwarf, const ClassUnknown = 0
    pkg debug/dwarf, const ClassUnknown Class
    pkg debug/elf, const COMPRESS_HIOS = 1879048191
    pkg debug/elf, const COMPRESS_HIOS CompressionType
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 13 23:40:13 UTC 2016
    - 12.9K bytes
    - Viewed (0)
  4. src/database/sql/sql_test.go

    		t.Errorf("closes = %d; want 0", closes)
    	}
    	if g, w := db.numFreeConns(), 2; g != w {
    		t.Errorf("free conns = %d; want %d", g, w)
    	}
    
    	// Expire first conn
    	offset = 11 * time.Second
    	db.SetConnMaxLifetime(10 * time.Second)
    
    	tx, err = db.Begin()
    	if err != nil {
    		t.Fatal(err)
    	}
    	tx2, err = db.Begin()
    	if err != nil {
    		t.Fatal(err)
    	}
    	tx.Commit()
    	tx2.Commit()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 111.6K bytes
    - Viewed (0)
  5. src/database/sql/sql.go

    	db.mu.Unlock()
    	if syncMaxIdle {
    		db.SetMaxIdleConns(n)
    	}
    }
    
    // SetConnMaxLifetime sets the maximum amount of time a connection may be reused.
    //
    // Expired connections may be closed lazily before reuse.
    //
    // If d <= 0, connections are not closed due to a connection's age.
    func (db *DB) SetConnMaxLifetime(d time.Duration) {
    	if d < 0 {
    		d = 0
    	}
    	db.mu.Lock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 103.6K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(*DB).Query", Method, 0},
    		{"(*DB).QueryContext", Method, 8},
    		{"(*DB).QueryRow", Method, 0},
    		{"(*DB).QueryRowContext", Method, 8},
    		{"(*DB).SetConnMaxIdleTime", Method, 15},
    		{"(*DB).SetConnMaxLifetime", Method, 6},
    		{"(*DB).SetMaxIdleConns", Method, 1},
    		{"(*DB).SetMaxOpenConns", Method, 2},
    		{"(*DB).Stats", Method, 5},
    		{"(*Null).Scan", Method, 22},
    		{"(*NullBool).Scan", Method, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top