shengdoupi commented on code in PR #25122:
URL: https://github.com/apache/shardingsphere/pull/25122#discussion_r1163599690


##########
features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/algorithm/keygen/SnowflakeKeyGenerateAlgorithm.java:
##########
@@ -113,7 +113,9 @@ private int getMaxVibrationOffset(final Properties props) {
     }
     
     private int getMaxTolerateTimeDifferenceMilliseconds(final Properties 
props) {
-        return 
Integer.parseInt(props.getOrDefault(MAX_TOLERATE_TIME_DIFFERENCE_MILLISECONDS_KEY,
 MAX_TOLERATE_TIME_DIFFERENCE_MILLISECONDS).toString());
+        int result = 
Integer.parseInt(props.getOrDefault(MAX_TOLERATE_TIME_DIFFERENCE_MILLISECONDS_KEY,
 MAX_TOLERATE_TIME_DIFFERENCE_MILLISECONDS).toString());
+        ShardingSpherePreconditions.checkState(result > 0, () -> new 
KeyGenerateAlgorithmInitializationException(getType(), "Illegal max tolerate 
time difference milliseconds."));

Review Comment:
   > `0` should be allowed here
   
   Thanks! It's already fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to