fog / fog-google

Fog for Google Cloud Platform
MIT License
99 stars 146 forks source link

Avoid duplicate GET requests when retrieving body #545

Closed stanhu closed 2 years ago

stanhu commented 2 years ago

Previously the response body would be loaded twice in memory whenever GoogleJSON::File#body was called. This was happening because inside the ternary condition, file.body was recursively calling itself twice even though the body was already loaded. We rewrite this method to be simpler and to have a proper base condition.

Closes https://github.com/fog/fog-google/issues/541

Temikus commented 2 years ago

@stanhu Thank you 🙌 I'll run the integration and then merge.

Temikus commented 2 years ago

Storage passing - merging. Still need to work out some kinks in flaky tests 🤔

stanhu commented 2 years ago

@Temikus Would you mind releasing a new version?

Temikus commented 2 years ago

@stanhu will kick off today, sorry for delay.