diff --git a/pkg/migration/file_leecher.go b/pkg/migration/file_leecher.go index af22063..baa565b 100644 --- a/pkg/migration/file_leecher.go +++ b/pkg/migration/file_leecher.go @@ -93,6 +93,7 @@ func (l *FileLeecher) Release() ( chan error, *sync.WaitGroup, string, + *os.File, ) { l.released = true diff --git a/pkg/migration/file_migrator.go b/pkg/migration/file_migrator.go index cec3d02..f0b3a69 100644 --- a/pkg/migration/file_migrator.go +++ b/pkg/migration/file_migrator.go @@ -196,7 +196,7 @@ func (s *FileMigrator) Leech( *services.SeederService, error, ) { - releasedDev, releasedErrs, releasedWg, releasedDeviceFile := s.leecher.Release() + releasedDev, releasedErrs, releasedWg, releasedDeviceFile, releasedServerFile := s.leecher.Release() s.released = true if err := s.leecher.Close(); err != nil { @@ -223,6 +223,7 @@ func (s *FileMigrator) Leech( releasedErrs, releasedWg, releasedDeviceFile, + releasedServerFile, file, ) diff --git a/pkg/migration/file_seeder.go b/pkg/migration/file_seeder.go index 94047e0..0cd0760 100644 --- a/pkg/migration/file_seeder.go +++ b/pkg/migration/file_seeder.go @@ -63,6 +63,7 @@ func NewFileSeederFromLeecher( errs chan error, wg *sync.WaitGroup, devicePath string, + serverFile *os.File, deviceFile *os.File, ) *FileSeeder { @@ -81,6 +82,7 @@ func NewFileSeederFromLeecher( errs, wg, devicePath, + serverFile, ), hooks: hooks, diff --git a/pkg/migration/path_leecher.go b/pkg/migration/path_leecher.go index 8ff4312..c212c81 100644 --- a/pkg/migration/path_leecher.go +++ b/pkg/migration/path_leecher.go @@ -321,6 +321,7 @@ func (l *PathLeecher) Release() ( chan error, *sync.WaitGroup, string, + *os.File, ) { l.finalizedCond.L.Lock() if !l.finalized { @@ -336,7 +337,7 @@ func (l *PathLeecher) Release() ( l.released = true - return l.dev, l.errs, l.devWg, l.devicePath + return l.dev, l.errs, l.devWg, l.devicePath, l.serverFile } func (l *PathLeecher) Close() error { diff --git a/pkg/migration/path_migrator.go b/pkg/migration/path_migrator.go index eb896b9..7613ea5 100644 --- a/pkg/migration/path_migrator.go +++ b/pkg/migration/path_migrator.go @@ -222,7 +222,7 @@ func (s *PathMigrator) Leech( *services.SeederService, error, ) { - releasedDev, releasedErrs, releasedWg, releasedDevicePath := s.leecher.Release() + releasedDev, releasedErrs, releasedWg, releasedDevicePath, releasedServerFile := s.leecher.Release() s.released = true if err := s.leecher.Close(); err != nil { @@ -249,6 +249,7 @@ func (s *PathMigrator) Leech( releasedErrs, releasedWg, releasedDevicePath, + releasedServerFile, ) go func() { diff --git a/pkg/migration/path_seeder.go b/pkg/migration/path_seeder.go index 7491db5..cdd291c 100644 --- a/pkg/migration/path_seeder.go +++ b/pkg/migration/path_seeder.go @@ -90,6 +90,7 @@ func NewPathSeederFromLeecher( errs chan error, wg *sync.WaitGroup, devicePath string, + serverFile *os.File, ) *PathSeeder { if options == nil { options = &SeederOptions{} @@ -113,6 +114,7 @@ func NewPathSeederFromLeecher( errs: errs, wg: wg, devicePath: devicePath, + serverFile: serverFile, } } diff --git a/pkg/migration/slice_leecher.go b/pkg/migration/slice_leecher.go index 4299635..d3e207e 100644 --- a/pkg/migration/slice_leecher.go +++ b/pkg/migration/slice_leecher.go @@ -114,6 +114,7 @@ func (l *SliceLeecher) Release() ( chan error, *sync.WaitGroup, string, + *os.File, ) { l.released = true diff --git a/pkg/migration/slice_migrator.go b/pkg/migration/slice_migrator.go index 3a64cfb..f3ccf97 100644 --- a/pkg/migration/slice_migrator.go +++ b/pkg/migration/slice_migrator.go @@ -195,7 +195,7 @@ func (s *SliceMigrator) Leech( *services.SeederService, error, ) { - releasedDev, releasedErrs, releasedWg, releasedDeviceSlice := s.leecher.Release() + releasedDev, releasedErrs, releasedWg, releasedDeviceSlice, releasedServerFile := s.leecher.Release() s.released = true if err := s.leecher.Close(); err != nil { @@ -222,6 +222,7 @@ func (s *SliceMigrator) Leech( releasedErrs, releasedWg, releasedDeviceSlice, + releasedServerFile, slice, ) diff --git a/pkg/migration/slice_seeder.go b/pkg/migration/slice_seeder.go index ebc50cf..043ddc2 100644 --- a/pkg/migration/slice_seeder.go +++ b/pkg/migration/slice_seeder.go @@ -67,6 +67,7 @@ func NewSliceSeederFromLeecher( errs chan error, wg *sync.WaitGroup, devicePath string, + releasedServerFile *os.File, deviceSlice []byte, ) *SliceSeeder { @@ -85,6 +86,7 @@ func NewSliceSeederFromLeecher( errs, wg, devicePath, + releasedServerFile, ), hooks: hooks,