Skip to content

Commit

Permalink
fix: 修复 timer.Pool 在获取到池中 Ticker 时,可选项不生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Apr 23, 2024
1 parent bcaf903 commit be6af14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/timer/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit be6af14

Please sign in to comment.