juftin / camply

camply, the campsite finder ⛺️ - a tool to find campsites at sold out campgrounds through sites like recreation.gov
https://juftin.com/camply/
MIT License
464 stars 89 forks source link

GoingToCamp: Fix session usage #342

Closed damz closed 3 months ago

damz commented 3 months ago

Description

The GoingToCamp provider doesn't reuse connections to the API because it doesn't use the requests session correctly:

[2024-04-28 19:08:44] DEBUG    Starting new HTTPS connection (1): reservation.pc.gc.ca:443                                                                                        
[2024-04-28 19:08:45] DEBUG    https://reservation.pc.gc.ca:443 "GET /api/resourceLocation HTTP/1.1" 200 None                                                                     
[2024-04-28 19:08:45] DEBUG    Starting new HTTPS connection (1): reservation.pc.gc.ca:443                                                                                        
[2024-04-28 19:08:45] DEBUG    https://reservation.pc.gc.ca:443 "GET /api/maps HTTP/1.1" 200 None  

Has This Been Tested?

Yes, with this change:

[2024-04-28 19:09:35] DEBUG    Starting new HTTPS connection (1): reservation.pc.gc.ca:443                                                                                        
[2024-04-28 19:09:36] DEBUG    https://reservation.pc.gc.ca:443 "GET /api/resourceLocation HTTP/1.1" 200 285741                                                                   
[2024-04-28 19:09:36] DEBUG    https://reservation.pc.gc.ca:443 "GET /api/maps HTTP/1.1" 200 4196808    

Checklist:

juftin commented 3 months ago

Nice, thank you. I think the GoingToCamp provider predates when the session property was part of the BaseProvider. This is a great improvement.

juftin commented 3 months ago

:tada: This PR is included in version 0.32.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: