Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for SetConnMaxLifetime (0.82 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)
Back to top