[PR #269] [MERGED] Refactor client internal calls to allow keepalive #836

Closed
opened 2026-02-28 00:02:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/269
Author: @sonneveld
Created: 3/30/2018
Status: Merged
Merged: 1/14/2020
Merged by: @stephanebruckert

Base: masterHead: client-internal-call-refactor


📝 Commits (4)

  • 7d121cb Close request object, not the whole connection. Allows keepalive
  • 5423899 Merge branch 'master' into client-internal-call-refactor
  • f8608c8 Close custom session in test
  • c591126 Changelog

📊 Changes

3 files changed (+35 additions, -35 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 spotipy/client.py (+30 -35)
📝 tests/tests.py (+1 -0)

📄 Description

Internal calls were closing the http connection after every request, which meant that subsequent queries had to recreate the connection. By only closing the request object, I halved the time it took to get my saved tracks:

loading saved tracks before:
real 0m39.799s

loading saved tracks after:
real 0m19.340s


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/spotipy-dev/spotipy/pull/269 **Author:** [@sonneveld](https://github.com/sonneveld) **Created:** 3/30/2018 **Status:** ✅ Merged **Merged:** 1/14/2020 **Merged by:** [@stephanebruckert](https://github.com/stephanebruckert) **Base:** `master` ← **Head:** `client-internal-call-refactor` --- ### 📝 Commits (4) - [`7d121cb`](https://github.com/spotipy-dev/spotipy/commit/7d121cbff5918aa07beb0c76aa4df22a97697132) Close request object, not the whole connection. Allows keepalive - [`5423899`](https://github.com/spotipy-dev/spotipy/commit/542389900f2c4ced59ada848e3e771d416f82bd8) Merge branch 'master' into client-internal-call-refactor - [`f8608c8`](https://github.com/spotipy-dev/spotipy/commit/f8608c80ebe590745e833673f60747582954d99e) Close custom session in test - [`c591126`](https://github.com/spotipy-dev/spotipy/commit/c5911268425736b82f8986ead9987cf6225817c7) Changelog ### 📊 Changes **3 files changed** (+35 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `spotipy/client.py` (+30 -35) 📝 `tests/tests.py` (+1 -0) </details> ### 📄 Description Internal calls were closing the http connection after every request, which meant that subsequent queries had to recreate the connection. By only closing the request object, I halved the time it took to get my saved tracks: loading saved tracks before: real 0m39.799s loading saved tracks after: real 0m19.340s --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:02:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#836
No description provided.