Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix:for deploy multi Gate,use snowflake generate sessionId #90

Merged
merged 3 commits into from
Nov 10, 2022

Conversation

bbdshow
Copy link
Contributor

@bbdshow bbdshow commented Nov 9, 2022

Fix:for deploy multi Gate,use snowflake generate sessionId
bugs: Register member slice maybe panic

What problem does this PR solve?

  1. 集群部署,多Gate节点,相同的sessionId,导致绑定关系异常。方案采用 snowflake 生成sessionId。

What is changed and how it works?

对 service.Connection 进行了接口定义,defaultConnectionServer为默认实现,实现依赖了 snowflake 方法。对于snowflake依赖的NodeId参数进行设定,默认使用 os.Getpid()%1000 也可通过 nano.WithNodeId() 进行指定。
新引入包:github.com/bwmarrin/snowflake v0.3.0

bugs: Register member slice maybe panic
@bbdshow bbdshow closed this Nov 9, 2022
@bbdshow bbdshow reopened this Nov 9, 2022
Copy link
Collaborator

@gsw945 gsw945 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, Thanks for your contribution!

@gsw945 gsw945 merged commit 2de04ef into lonng:master Nov 10, 2022
@bbdshow bbdshow deleted the origin-ver branch November 10, 2022 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants