修复uuid问题

This commit is contained in:
aozhiwei 2020-03-24 19:10:59 +08:00
parent 299189f7db
commit be16bf0233

View File

@ -66,7 +66,8 @@ func (id *idWorker) nextid() (int64, error) {
} else {
id.sequence = 0
}
sarly := time.Now().Unix() % nodeMask
var sarly int64 = 1
//sarly := time.Now().Unix() % nodeMask
id.lastTimestamp = timestamp
return ((timestamp - id.twepoch) << timestampLeftShift) | (sarly << nodeIdShift) | id.sequence, nil
}