Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract a block containing defer in cache_archive.go's Write loop #32

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

akihikodaki
Copy link
Contributor

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.

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.
@codecov-io
Copy link

Codecov Report

Merging #32 into master will increase coverage by 0.07%.
The diff coverage is 32.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   42.44%   42.51%   +0.07%     
==========================================
  Files           6        6              
  Lines         417      421       +4     
==========================================
+ Hits          177      179       +2     
- Misses        213      214       +1     
- Partials       27       28       +1
Impacted Files Coverage Δ
cache_archive.go 29.78% <32.14%> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43d9deb...4314f37. Read the comment docs.

@lpusok
Copy link
Contributor

lpusok commented Oct 4, 2019

Thanks @akihikodaki,
This looks good to me.

@lpusok lpusok requested review from lpusok and removed request for lpusok October 4, 2019 14:24
@lpusok lpusok self-assigned this Oct 4, 2019
@lpusok lpusok requested a review from trapacska October 4, 2019 14:25
@lpusok
Copy link
Contributor

lpusok commented Oct 4, 2019

@trapacska can you please merge this?

@trapacska trapacska merged commit f8390e7 into bitrise-steplib:master Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants