This commit is contained in:
@@ -126,6 +126,12 @@ func (p *RemoteGrainPool) findOrCreateGrain(id CartId) *RemoteGrain {
|
|||||||
return grain
|
return grain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *RemoteGrainPool) Delete(id CartId) {
|
||||||
|
p.mu.Lock()
|
||||||
|
delete(p.grains, id)
|
||||||
|
p.mu.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
func (p *RemoteGrainPool) Process(id CartId, messages ...Message) ([]byte, error) {
|
func (p *RemoteGrainPool) Process(id CartId, messages ...Message) ([]byte, error) {
|
||||||
var result []byte
|
var result []byte
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ func (p *SyncedPool) RemoveHostMappedCarts(host *RemoteHost) {
|
|||||||
defer p.mu.Unlock()
|
defer p.mu.Unlock()
|
||||||
for id, r := range p.remoteIndex {
|
for id, r := range p.remoteIndex {
|
||||||
if r == host.Pool {
|
if r == host.Pool {
|
||||||
|
p.remoteIndex[id].Delete(id)
|
||||||
delete(p.remoteIndex, id)
|
delete(p.remoteIndex, id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,6 +377,7 @@ func (p *SyncedPool) getGrainPool(id CartId) (GrainPool, error) {
|
|||||||
p.mu.RUnlock()
|
p.mu.RUnlock()
|
||||||
if ok {
|
if ok {
|
||||||
if remotePool == nil {
|
if remotePool == nil {
|
||||||
|
p.remoteIndex[id].Delete(id)
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
delete(p.remoteIndex, id)
|
delete(p.remoteIndex, id)
|
||||||
p.mu.Unlock()
|
p.mu.Unlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user