|
|
|
@ -80,7 +80,7 @@ public class IdWorker {
|
|
|
|
|
public synchronized long nextId() {
|
|
|
|
|
long timestamp = timeGen();
|
|
|
|
|
if (timestamp < lastTimestamp) {
|
|
|
|
|
throw new BizException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
|
|
|
|
|
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lastTimestamp == timestamp) {
|
|
|
|
|