tests: correctly close filesystems

This commit is contained in:
Elias Schneider
2026-07-26 23:30:36 +02:00
parent 31d62c65e5
commit 6bd4679bab
10 changed files with 62 additions and 8 deletions
+5
View File
@@ -43,6 +43,11 @@ func runExport(ctx context.Context, flags exportFlags) error {
return fmt.Errorf("failed to initialize storage: %w", err)
}
// Close filesystem storage handles before the command exits
defer func() {
_ = storage.Close()
}()
exportService := service.NewExportService(db, storage)
var w io.Writer
+5
View File
@@ -88,6 +88,11 @@ func runImport(ctx context.Context, flags importFlags) error {
return fmt.Errorf("failed to initialize storage: %w", err)
}
// Close filesystem storage handles before the command exits
defer func() {
_ = storage.Close()
}()
importService := service.NewImportService(db, storage)
err = importService.ImportFromZip(ctx, &zipReader.Reader)
if err != nil {