Skip to content

Commit

Permalink
fix: capture loop variable, should fix juruen#285
Browse files Browse the repository at this point in the history
  • Loading branch information
ddvk committed Sep 23, 2024
1 parent 0f12ffe commit 95dd565
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/sync15/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func getCachedTreePath() (string, error) {
return cacheFile, nil
}

const cacheVersion = 2
const cacheVersion = 3

func loadTree() (*HashTree, error) {
cacheFile, err := getCachedTreePath()
Expand Down
3 changes: 2 additions & 1 deletion api/sync15/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ func (t *HashTree) Mirror(r RemoteStorage, maxconcurrent int) error {
if entry.Hash != doc.Hash {
log.Info.Println("doc updated: ", doc.DocumentID)
e := entry
d := doc
wg.Go(func() error {
return doc.Mirror(e, r)
return d.Mirror(e, r)
})
}
}
Expand Down

0 comments on commit 95dd565

Please sign in to comment.