Skip to content
jolestar edited this page Jan 18, 2016 · 2 revisions

How to config pool schedule check pooled object is active at background? I do not want check on borrow or return?

//set pool TimeBetweenEvictionRunsMillis to schedule peroid, eg: 3000 millisecond
pool.Config.TimeBetweenEvictionRunsMillis = 3000
pool.Config.TestWhileIdle = true
//restart evector goroutine to let TimeBetweenEvictionRunsMillis change take effect.
pool.StartEvictor()