diff --git a/snowflake.go b/snowflake.go index 4ae8db2..ca0b3dd 100644 --- a/snowflake.go +++ b/snowflake.go @@ -54,7 +54,6 @@ func NewNode(node int64) (*Node, error) { func (n *Node) Generate() ID { n.Lock() - defer n.Unlock() now := time.Now().UnixNano() / 1000000 @@ -72,10 +71,13 @@ func (n *Node) Generate() ID { n.time = now - return ID((now-Epoch)<