fix copy status handoff before cleanup

This commit is contained in:
Samuel Cui
2026-08-18 18:30:24 +08:00
parent 3fe7bb3702
commit 4c33c74475
2 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -83,12 +83,12 @@ func (c *Copyer) copy(ctx context.Context, prepared <-chan *writeJob) <-chan *ba
func (c *Copyer) write(ctx context.Context, job *writeJob, ch chan<- *baseJob, cntr *counter, noSpaceDevices mapset.Set[string]) {
job.setStatus(jobStatusCopying)
defer job.setStatus(jobStatusFinishing)
var wg sync.WaitGroup
defer func() {
wg.Wait()
job.done()
job.setStatus(jobStatusFinishing)
ch <- job.baseJob
}()