SouthwestCheckin icon indicating copy to clipboard operation
SouthwestCheckin copied to clipboard

Multiple attempts with safe_requests not always necessary

Open jpetermans opened this issue 6 years ago • 2 comments

Great script! Love the use of the iOS app to simplify the interactions.

Currently safe_request() makes multiple attempts up to MAX_ATTEMPTS any time it is called. This is only needed when checking in with checkin(). Currently, if a user supplies a bad record or name, the script makes multiple requests even with bad inputs.

In the interest of keeping requests low impact, you could have something like <safe_request(url, body=None, retry=False)>, and supply retry = True only when needed, like when it's time to attempt a checkin. This way avoids hitting the server with lots of bad requests in the event bad inputs are provided.

jpetermans avatar Jan 25 '19 23:01 jpetermans

Definitely an improvement that can be made, though I'm not too worried about hurting their servers.

Soutwest has ~4,000 flights per day, with ~130 passengers per flight, making 520,000 check-ins necessary per day. If even everyone who starred this repo had a flight every day (which is unlikely), and put in bad data, that's only 2,600 bad requests, which is half a single percent of the daily load.

I love the idea, I just want to be transparent about why I probably won't be putting it on the top of my priority list when coding. Definitely would merge a PR for it though!

pyro2927 avatar Feb 03 '19 04:02 pyro2927

I agree their servers can handle it. I was coming at this more from a desire to draw less attention and lose a great tool. I'll play with this a little and see about submitting a PR.

jpetermans avatar Feb 05 '19 20:02 jpetermans