From 1b91948f8430059677e5041733c02fd9b90f0879 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 29 Dec 2019 13:00:34 +0000 Subject: close files after parsing --- lib/MaildirIndexer/Parser.pm6 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/MaildirIndexer/Parser.pm6 b/lib/MaildirIndexer/Parser.pm6 index 1aa658b..420d4c3 100644 --- a/lib/MaildirIndexer/Parser.pm6 +++ b/lib/MaildirIndexer/Parser.pm6 @@ -69,14 +69,16 @@ multi parse-email(IO::Path:D $p --> MaildirIndexer::Email) is export { multi parse-email(IO::Path:D $p, :$headers-only! --> MaildirIndexer::Email) is export { my MaildirIndexer::Email $result; MaildirIndexer::LogTimelineSchema::Parse::Email::File.log: :file($p.path), -> { - $result = parse-email( - $p.lines( + my IO::Handle $h = $p.open( :enc, :nl-in(@separators), :!chomp, - )[0], + ); + $result = parse-email( + $h.lines()[0], path => $p, ); + $h.close(); } return $result; } -- cgit v1.2.3