添加snowflake的datacenterId和workerId的ID分配策略,利用redis的原子锁特性

This commit is contained in:
wangkang
2017-09-04 19:21:19 +08:00
parent 8104e5c54e
commit 34698cd47d
@@ -37,12 +37,12 @@ public class IdWorkerInit {
/**
* key的过期时间
*/
private static final long EXPIRATION = 30;
private static final long EXPIRATION = 70;
/**
* job执行时间
*/
private static final long JOB_RUN_TIME = 20l * 1000l;
private static final long JOB_RUN_TIME = 60 * 1000l;
/**
* 机器ID( 0 - 31 )