From ba4c081710a1da4187f7df3650dd27a6d69bcee3 Mon Sep 17 00:00:00 2001 From: Radhi Fadlillah Date: Mon, 12 Aug 2019 22:06:36 +0700 Subject: [PATCH] Minor fix: no more closing channels --- pkg/warc/writer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/warc/writer.go b/pkg/warc/writer.go index d0a6a3b..92c727c 100644 --- a/pkg/warc/writer.go +++ b/pkg/warc/writer.go @@ -66,7 +66,11 @@ func NewArchive(req ArchivalRequest, dstPath string) error { ResourceMap: make(map[string]struct{}), LogEnabled: req.LogEnabled, } - defer arc.Close() + + // TODO: investigate whether the channel must be closed or not. + // At first, I thought the channels must be closed. Unfortunately, it leads to + // a panic when error message is accidentally sent after error channels closed. + // defer arc.Close() // Process input depending on its type. // If it's HTML, we need to extract the sub resources that used by it, e.g some CSS or JS files.