taskid加同步锁,防止创建相同id
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package org.nl.wms.util;
|
package org.nl.wms.util;
|
||||||
|
|
||||||
public class IdUtil {
|
public class IdUtil {
|
||||||
public static Long getLongId() {
|
public synchronized static Long getLongId() {
|
||||||
return cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId();
|
return cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user