Skip to content

Commit

Permalink
v0.23.0-RC7 panic: tempFile: Close() called on a closed file (#644)
Browse files Browse the repository at this point in the history
Fixes #643
  • Loading branch information
simulot authored Jan 19, 2025
1 parent bde0cee commit 42bb9eb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion adapters/folder/writeFolder.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func (w *LocalAssetWriter) WriteAsset(ctx context.Context, a *assets.Asset) erro

// write the asset
err = fshelper.WriteFile(w.WriteToFS, path.Join(dir, base), r)
r.Close()
if err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions internal/e2eTests/archive/e2e_archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestArchiveFromGooglePhotos(t *testing.T) {
c, a := cmd.RootImmichGoCommand(ctx)
c.SetArgs([]string{
"archive", "from-google-photos",
"--log-level=debug",
"--write-to-folder=" + tmpDir,
e2e.MyEnv("IMMICHGO_TESTFILES") + "/demo takeout/Takeout",
})
Expand Down
2 changes: 1 addition & 1 deletion internal/fshelper/cachereader/cachereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type tempFile struct {

func (t *tempFile) Close() error {
refs := atomic.AddInt64(&t.cr.references, -1)
loghelper.Debug("tempFile:", "close file", t.File.Name(), "references", refs+1)
loghelper.Debug("tempFile:", "assetName", t.cr.name, "close file", t.File.Name(), "references", refs+1)
if refs < 0 {
panic("tempFile: Close() called on a closed file")
}
Expand Down

0 comments on commit 42bb9eb

Please sign in to comment.