From 6d1f83e0ad9dd4c4b51cd2e54de072cf4ca8faef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sun, 24 May 2020 01:15:02 -0300 Subject: [PATCH] Close package file handle as soon as possible --- cmd/xmandump/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/xmandump/main.go b/cmd/xmandump/main.go index a16c625..fd1d846 100644 --- a/cmd/xmandump/main.go +++ b/cmd/xmandump/main.go @@ -309,7 +309,6 @@ func (d *Dumper) processPackage(ctx context.Context, pkg *xrepo.Package, file st Error(ctx, "Cannot open file", zap.Error(err)) return err } - defer logClose(ctx, f) mime, err := mimetype.DetectFile(file) if err != nil { @@ -410,6 +409,7 @@ scanPackage: done: d.recordChange(pkg.FilenameSHA256) + f.Close() return nil }