Skip to content

Commit

Permalink
fix: add close method for progress bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
syhily committed Nov 15, 2022
1 parent 26b7ce3 commit 2bd7ade
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ func (f *commonFetcher) downloadFile(bookID int64, format Format) error {

// Add download progress.
bar := log.NewProgressBar(bookID, f.progress.Size(), file.name, file.size)
defer func() { _ = bar.Close() }()

// Write file content
_, err = io.Copy(io.MultiWriter(writer, bar), file.content)
Expand Down

0 comments on commit 2bd7ade

Please sign in to comment.