engine_maxlife.go 385 B

1234567891011121314
  1. // Copyright 2017 The Xorm Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build go1.6
  5. package xorm
  6. import "time"
  7. // SetConnMaxLifetime sets the maximum amount of time a connection may be reused.
  8. func (engine *Engine) SetConnMaxLifetime(d time.Duration) {
  9. engine.db.SetConnMaxLifetime(d)
  10. }