Fix locking screwup
This commit is contained in:
parent
3388d5b49c
commit
884bb638bc
@ -346,7 +346,6 @@ func (m *Model) Index(nodeID protocol.NodeID, repo string, fs []protocol.FileInf
|
|||||||
} else {
|
} else {
|
||||||
l.Fatalf("Index for nonexistant repo %q", repo)
|
l.Fatalf("Index for nonexistant repo %q", repo)
|
||||||
}
|
}
|
||||||
m.rmut.RUnlock()
|
|
||||||
|
|
||||||
events.Default.Log(events.RemoteIndexUpdated, map[string]interface{}{
|
events.Default.Log(events.RemoteIndexUpdated, map[string]interface{}{
|
||||||
"node": nodeID.String(),
|
"node": nodeID.String(),
|
||||||
@ -371,13 +370,11 @@ func (m *Model) IndexUpdate(nodeID protocol.NodeID, repo string, fs []protocol.F
|
|||||||
m.rmut.RLock()
|
m.rmut.RLock()
|
||||||
r, ok := m.repoFiles[repo]
|
r, ok := m.repoFiles[repo]
|
||||||
m.rmut.RUnlock()
|
m.rmut.RUnlock()
|
||||||
m.rmut.RLock()
|
|
||||||
if ok {
|
if ok {
|
||||||
r.Update(nodeID, fs)
|
r.Update(nodeID, fs)
|
||||||
} else {
|
} else {
|
||||||
l.Fatalf("IndexUpdate for nonexistant repo %q", repo)
|
l.Fatalf("IndexUpdate for nonexistant repo %q", repo)
|
||||||
}
|
}
|
||||||
m.rmut.RUnlock()
|
|
||||||
|
|
||||||
events.Default.Log(events.RemoteIndexUpdated, map[string]interface{}{
|
events.Default.Log(events.RemoteIndexUpdated, map[string]interface{}{
|
||||||
"node": nodeID.String(),
|
"node": nodeID.String(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user