This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
type RemoteGrainPool struct {
|
||||
mu sync.RWMutex
|
||||
Host string
|
||||
grains map[CartId]RemoteGrain
|
||||
grains map[CartId]*RemoteGrain
|
||||
}
|
||||
|
||||
func (id CartId) String() string {
|
||||
@@ -99,7 +99,7 @@ func (g *RemoteGrain) GetCurrentState() ([]byte, error) {
|
||||
func NewRemoteGrainPool(addr string) *RemoteGrainPool {
|
||||
return &RemoteGrainPool{
|
||||
Host: addr,
|
||||
grains: make(map[CartId]RemoteGrain),
|
||||
grains: make(map[CartId]*RemoteGrain),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ func (p *RemoteGrainPool) findRemoteGrain(id CartId) *RemoteGrain {
|
||||
return nil
|
||||
}
|
||||
grain.Connect()
|
||||
return &grain
|
||||
return grain
|
||||
}
|
||||
|
||||
func (p *RemoteGrainPool) findOrCreateGrain(id CartId) *RemoteGrain {
|
||||
@@ -119,7 +119,7 @@ func (p *RemoteGrainPool) findOrCreateGrain(id CartId) *RemoteGrain {
|
||||
if grain == nil {
|
||||
grain = NewRemoteGrain(id, p.Host)
|
||||
p.mu.Lock()
|
||||
p.grains[id] = *grain
|
||||
p.grains[id] = grain
|
||||
p.mu.Unlock()
|
||||
grain.Connect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user