pseudonym117 / Riot-Watcher

Simple Python wrapper for the Riot Games API for League of Legends
MIT License
532 stars 150 forks source link

Add requests sessions #188

Closed hingston closed 3 years ago

hingston commented 3 years ago

Would it be more efficient to use requests.Session()?

The Session object allows you to persist certain parameters across requests. It also persists cookies across all requests made from the Session instance, and will use urllib3’s connection pooling. So if you’re making several requests to the same host, the underlying TCP connection will be reused, which can result in a significant performance increase (see HTTP persistent connection).

Currently using requests.get(): https://github.com/pseudonym117/Riot-Watcher/blob/16659b30898dae9f62cee9ddaa8711469f1d0ddd/src/riotwatcher/_apis/BaseApi.py#L41

187

codecov[bot] commented 3 years ago

Codecov Report

Merging #188 (b052e74) into master (16659b3) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #188   +/-   ##
=======================================
  Coverage   94.32%   94.33%           
=======================================
  Files          85       85           
  Lines        1022     1023    +1     
  Branches       68       68           
=======================================
+ Hits          964      965    +1     
  Misses         38       38           
  Partials       20       20           
Impacted Files Coverage Δ
src/riotwatcher/_apis/BaseApi.py 88.46% <100.00%> (+0.22%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 16659b3...b052e74. Read the comment docs.