Skip to content

token可能重复的问题 #4

Description

@shencongcong

func GetProcessAndGoroutineIDStr() string {
return fmt.Sprintf("%s_%s", GetCurrentProcessID(), GetCurrentGoroutineID())
}
这里用进程id 拼接 协程id 在分布式场景下可能会重复吧

添加一下机器的标识,这样确保一定不会重复应该会更好吧?
func GetProcessAndGoroutineIDStr() string {
hostname, _ := os.Hostname()

return fmt.Sprintf("%s_%s_%s", hostname, GetCurrentProcessID(), GetCurrentGoroutineID())

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions