zheng-ji / goSnowFlake

一个实现 Twitter SnowFlake 算法 的 Go 分布式 UID 生成器.A threadsafe unique ID generator inspired by Twitter SnowFlake theory
MIT License
364 stars 75 forks source link

Endless loop in 'timeReGen' #1

Closed flopp closed 8 years ago

flopp commented 8 years ago

There's something wrong with the for loop in func (iw *IdWorker) timeReGen(last int64) int64 {...} There's no loop condition, there's no break or return in the loop's body => it will loop forever!

zheng-ji commented 8 years ago

Thanks For your Concern, i have fixed this bug : ), code here.You can pull request if you are interesting as well.welcome.