Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal-Leszczynski committed Nov 17, 2023
1 parent 3337295 commit 40c8136
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/accounting/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ func (tr *Transfer) Done(ctx context.Context, err error) {
tr.stats.PruneTransfers()
}

func (tr *Transfer) IdenticalCheck() {
tr.mu.Lock()
defer tr.mu.Unlock()
tr.acc.mu.Lock()
defer tr.acc.mu.Unlock()
tr.acc.values.bytes = -1
}

// Reset allows to switch the Account to another transfer method.
func (tr *Transfer) Reset(ctx context.Context) {
tr.mu.RLock()
Expand Down
1 change: 1 addition & 0 deletions fs/operations/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (c *checkMarch) checkIdentical(ctx context.Context, dst, src fs.Object) (di
tr := accounting.Stats(ctx).NewCheckingTransfer(src)
defer func() {
tr.Done(ctx, err)
tr.IdenticalCheck()
}()
if sizeDiffers(ctx, src, dst) {
err = errors.Errorf("Sizes differ")
Expand Down

0 comments on commit 40c8136

Please sign in to comment.