dgraph-io / dgraph

The database for modern applications. Common use cases: knowledge graphs for AI, fraud detection, personalization, and search. Built and maintained by @HypermodeInc.
https://dgraph.io
Other
20.47k stars 1.5k forks source link

chore(repo): close response bodies to prevent resource leaks #9193

Closed xqqp closed 1 month ago

xqqp commented 1 month ago
xqqp commented 1 month ago

@mangalaman93 The errors are now logged outside of test files.

xqqp commented 1 month ago

Thank you for the update. Could you also update to use %v instead of %s in the glog so that it gets logged correctly. While you do that, you could also keep the structure like this (this is a nit):

      if err := resp.Body.Close(); err != nil {
          glog.Errorf("Error while closing response body: %v", err)
      }

Done