This commit is contained in:
2025-07-04 23:41:19 +08:00
parent 7c2c32a31a
commit f0fd00d706
27 changed files with 1206 additions and 163 deletions

View File

@@ -20,7 +20,7 @@ type IService interface {
type Base struct {
Target string
SID string
SID int64
Serve *grpc.Server
EtcdTTL int64
OnInit func(serve *grpc.Server)
@@ -32,7 +32,7 @@ type Base struct {
func (s *Base) Init(addr string, port int) {
s.wg = &sync.WaitGroup{}
s.wg.Add(1)
s.SID = utils.SnowflakeInstance().Generate().String()
s.SID = utils.SnowflakeInstance().Generate().Int64()
go func() {
defer s.wg.Done()
defer s.OnClose()