feat: refactor grpc keepalive

This commit is contained in:
naiba
2024-12-05 00:11:34 +08:00
parent 68e3bb00e4
commit be51c5a1e6
12 changed files with 102 additions and 152 deletions

View File

@@ -3,7 +3,6 @@ package rpc
import (
"context"
"strings"
"sync"
petname "github.com/dustinkirkland/golang-petname"
"github.com/hashicorp/go-uuid"
@@ -64,7 +63,6 @@ func (a *authHandler) Check(ctx context.Context) (uint64, error) {
}
s.Host = &model.Host{}
s.State = &model.HostState{}
s.TaskCloseLock = new(sync.Mutex)
// generate a random silly server name
singleton.ServerList[s.ID] = &s
singleton.ServerUUIDToID[clientUUID] = s.ID