fix: 修复 timer.Pool 在获取到池中 Ticker 时,可选项不生效的问题
This commit is contained in:
parent
bcaf9030aa
commit
be6af14261
|
@ -46,6 +46,9 @@ func (slf *Pool) GetTicker(size int, options ...Option) *Ticker {
|
|||
if len(slf.tickers) > 0 {
|
||||
ticker = slf.tickers[0]
|
||||
slf.tickers = slf.tickers[1:]
|
||||
for _, option := range options {
|
||||
option(ticker)
|
||||
}
|
||||
return ticker
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue