Closed doudouwyh closed 5 years ago
node, err = sf.NewNode(1) all machines init with the same number 1
I'm guessing you're last comment is to explain why you had the issue, but to be clear.
All nodes must be set to a unique node number. If you configure multiple nodes with the same node number then you will receive duplicate IDs.
we got same ids from two machine, code likes below:
`var node *sf.Node func init_node() (err error) { node, err = sf.NewNode(1) if err != nil { panic("init node failed!") return } return }
func GenOrderid() { for { for i := 0; i < 4000; i++ { id := node.Generate() sorderid := strconv.FormatInt(id,10) if strings.TrimSpace(sorderid) == "" { continue }
}`