fix: address code review findings

This commit is contained in:
2026-07-19 19:07:20 +03:00
parent a4c426f640
commit c70f46af27
10 changed files with 77 additions and 124 deletions

View File

@@ -35,6 +35,12 @@ func NewClient(cfg config.MusicBrainzConfig) *MusicBrainzClient {
}
}
// Close releases resources held by the client, draining any idle keep-alive
// connections so they don't linger until garbage collection.
func (c *MusicBrainzClient) Close() {
c.httpClient.CloseIdleConnections()
}
// doGet performs a rate-limited HTTP GET request to the MusicBrainz API.
// It blocks until the rate limiter allows the request, then sets the proper
// User-Agent header and returns the response body.