From 95dd565281c54e4975aa12f33419812f0314a13c Mon Sep 17 00:00:00 2001 From: ddvk <36803246+ddvk@users.noreply.github.com> Date: Sun, 1 Jan 2023 23:21:35 +0100 Subject: [PATCH] fix: capture loop variable, should fix #285 --- api/sync15/common.go | 2 +- api/sync15/tree.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/sync15/common.go b/api/sync15/common.go index c73358b..2ed7457 100644 --- a/api/sync15/common.go +++ b/api/sync15/common.go @@ -41,7 +41,7 @@ func getCachedTreePath() (string, error) { return cacheFile, nil } -const cacheVersion = 2 +const cacheVersion = 3 func loadTree() (*HashTree, error) { cacheFile, err := getCachedTreePath() diff --git a/api/sync15/tree.go b/api/sync15/tree.go index 2d6b251..3889c43 100644 --- a/api/sync15/tree.go +++ b/api/sync15/tree.go @@ -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) }) } }