Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ func getDebugIMAPWriter() io.Writer {
return nil
}

// CloseDebugFiles cleans up debug file handles opened during the session.
func CloseDebugFiles() {
if debugIMAPFile != nil {
debugIMAPFile.Close()
}
}

// Attachment holds data for an email attachment.
type Attachment struct {
Filename string
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3947,6 +3947,7 @@ func main() {
args, level := parseGlobalFlags(os.Args)
os.Args = args
loglevel.Set(level)
defer fetcher.CloseDebugFiles()

// If invoked with version flag, print version and exit
if len(os.Args) > 1 && (os.Args[1] == "-v" || os.Args[1] == "--version" || os.Args[1] == "version") {
Expand Down
Loading