Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple attempts with safe_requests not always necessary #25

Open
jpetermans opened this issue Jan 25, 2019 · 2 comments
Open

Multiple attempts with safe_requests not always necessary #25

jpetermans opened this issue Jan 25, 2019 · 2 comments

Comments

@jpetermans
Copy link

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.

@pyro2927
Copy link
Owner

pyro2927 commented Feb 3, 2019

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!

@jpetermans
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants