func (*DB) SetConnMaxLifetime

func (db *DB) SetConnMaxLifetime(d time.Duration)

设置可重用连接的最大时间量。

过期的连接可能在重用之前被延迟关闭。

如果 d < = 0,则连接不会因为连接的时长而关闭。