Skip to content

Commit

Permalink
Added file.Close() call to file cache Get() method
Browse files Browse the repository at this point in the history
The Get() method for the file cache was not closing files
that it opened. This will eventually cause an issue with
too many file descriptors being open.

closes go-spatial#586
  • Loading branch information
ARolek committed Oct 11, 2021
1 parent 5013d27 commit 0478103
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cache/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (fc *Cache) Get(key *cache.Key) ([]byte, bool, error) {

return nil, false, err
}
defer f.Close()

val, err := ioutil.ReadAll(f)
if err != nil {
Expand Down

0 comments on commit 0478103

Please sign in to comment.