-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract a block containing defer in cache_archive.go's Write loop (#32)
The deferred executions are responsible for closing files, but will not be executed until the function returns. Therefore, so many files will remain open at the time the old implementation of Write returns, which can cause "too many files open" error. This change fixes the problem by extracting defer into another function which does not contain a loop.
- Loading branch information
1 parent
43d9deb
commit f8390e7
Showing
1 changed file
with
41 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters