diff options
| author | Nick White <git@njw.name> | 2019-10-16 15:40:07 +0100 |
|---|---|---|
| committer | Nick White <git@njw.name> | 2019-10-16 15:40:07 +0100 |
| commit | b5d712cb5a2cad026a2965ab52964e63ca0c6fe0 (patch) | |
| tree | 8275ee6688459cf71d354d5a0d2c1e05584f5816 /cmd | |
| parent | e92a3571e87ed6ac8aed4b6a5cb5a3fa489da4f4 (diff) | |
Ensure files are promptly closed by booktopipeline
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/booktopipeline/main.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/booktopipeline/main.go b/cmd/booktopipeline/main.go index 6d9f146..6e10475 100644 --- a/cmd/booktopipeline/main.go +++ b/cmd/booktopipeline/main.go @@ -127,6 +127,10 @@ func main() { if err != nil { log.Fatalln("Failed to upload", path, err) } + // Explicitly close here rather than wait for the defer, so we + // don't end up with too many open files which can cause os.Open + // to fail. + file.Close() } verboselog.Println("Sending message", bookname, "to queue", qurl) |
