Complete refactor to new grpc control plane and only http proxy for carts #4

Merged
mats merged 75 commits from refactor/http-proxy into main 2025-10-14 22:31:28 +02:00
Showing only changes of commit 67b9a739fe - Show all commits

View File

@@ -144,8 +144,17 @@ func (p *SimpleGrainPool[V]) TakeOwnership(id uint64) {
} }
func (p *SimpleGrainPool[V]) AddRemote(host string) (Host, error) { func (p *SimpleGrainPool[V]) AddRemote(host string) (Host, error) {
if host == "" || host == p.hostname || p.IsKnown(host) { if host == "" {
return nil, fmt.Errorf("invalid host") return nil, fmt.Errorf("host is empty")
}
if host == p.hostname {
return nil, fmt.Errorf("same host, this should not happen")
}
p.remoteMu.RLock()
existing, found := p.remoteHosts[host]
p.remoteMu.RUnlock()
if found {
return existing, nil
} }
remote, err := p.spawnHost(host) remote, err := p.spawnHost(host)