mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
No need to hold a write lock in Override
This commit is contained in:
parent
e6f04ed238
commit
db3e3ade80
@ -858,8 +858,10 @@ func (m *Model) State(repo string) string {
|
||||
func (m *Model) Override(repo string) {
|
||||
fs := m.NeedFilesRepo(repo)
|
||||
|
||||
m.rmut.Lock()
|
||||
m.rmut.RLock()
|
||||
r := m.repoFiles[repo]
|
||||
m.rmut.RUnlock()
|
||||
|
||||
for i := range fs {
|
||||
f := &fs[i]
|
||||
h := r.Get(cid.LocalID, f.Name)
|
||||
@ -873,7 +875,6 @@ func (m *Model) Override(repo string) {
|
||||
}
|
||||
f.Version = lamport.Default.Tick(f.Version)
|
||||
}
|
||||
m.rmut.Unlock()
|
||||
|
||||
r.Update(cid.LocalID, fs)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user