Fix locking screwup

This commit is contained in:
Jakob Borg 2014-07-18 10:00:20 +02:00
parent 3388d5b49c
commit 884bb638bc

View File

@ -346,7 +346,6 @@ func (m *Model) Index(nodeID protocol.NodeID, repo string, fs []protocol.FileInf
} else {
l.Fatalf("Index for nonexistant repo %q", repo)
}
m.rmut.RUnlock()
events.Default.Log(events.RemoteIndexUpdated, map[string]interface{}{
"node": nodeID.String(),
@ -371,13 +370,11 @@ func (m *Model) IndexUpdate(nodeID protocol.NodeID, repo string, fs []protocol.F
m.rmut.RLock()
r, ok := m.repoFiles[repo]
m.rmut.RUnlock()
m.rmut.RLock()
if ok {
r.Update(nodeID, fs)
} else {
l.Fatalf("IndexUpdate for nonexistant repo %q", repo)
}
m.rmut.RUnlock()
events.Default.Log(events.RemoteIndexUpdated, map[string]interface{}{
"node": nodeID.String(),