fix: 修复 timer.Pool 在获取到池中 Ticker 时,可选项不生效的问题

This commit is contained in:
kercylan98 2024-04-23 10:46:59 +08:00
parent bcaf9030aa
commit be6af14261
1 changed files with 3 additions and 0 deletions

View File

@ -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
}