From b354379b9cf09cb7e60a23bb7772cfd9254f1796 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 26 Sep 2017 13:25:50 +0800 Subject: [PATCH] remove unused method --- engine.go | 5 ----- engine_group_policy.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/engine.go b/engine.go index 9e7053ab..61748adf 100644 --- a/engine.go +++ b/engine.go @@ -1583,8 +1583,3 @@ func (engine *Engine) BufferSize(size int) *Session { session.isAutoClose = true return session.BufferSize(size) } - -//Stats return the number of open connections to the database -func (engine *Engine) Stats() int { - return engine.DB().Stats().OpenConnections -} diff --git a/engine_group_policy.go b/engine_group_policy.go index c3e528ad..175f8e39 100644 --- a/engine_group_policy.go +++ b/engine_group_policy.go @@ -135,7 +135,7 @@ func (policy *LeastConnPolicy) Slave(g *EngineGroup) *Engine { connections := 0 idx := 0 for i, _ := range slaves { - open_connections := slaves[i].Stats() + open_connections := slaves[i].DB().Stats().OpenConnections if i == 0 { connections = open_connections idx = i