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

Don't retry codeforces submission fetching if handle is incorrect #167

Open
prateek2211 opened this issue Jun 14, 2020 · 7 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@prateek2211
Copy link
Member

Currently if the codeforces API gives status which is not "OK", then it retries, assuming that max API limit is exceeded. But status could be not "OK", even if handle is invalid.

https://github.com/mdg-iitr/Codephile/blob/d6bcea4f3e5c2417420e37822c61ca8c0e06c4c8/scrappers/codeforces/scrapper.go#L60

Try this: http://codeforces.com/api/user.status?handle=incorrect-handle&from=500&count=50

@prateek2211 prateek2211 added the bug Something isn't working label Jun 14, 2020
@Arnesh07 Arnesh07 self-assigned this Jun 19, 2020
@Arnesh07
Copy link
Member

Arnesh07 commented Jun 21, 2020

@prateek2211 shouldn't we verify the handle first before fetching the submissions?

Handle verification takes quite significant time.
Verifying it everytime we fetch submissions would be too much overkill

@dev-ritik
Copy link
Member

dev-ritik commented Jun 21, 2020

Are the response status code for max API limit is exceeded and handle is invalid the same?

@prateek2211
Copy link
Member Author

the status is "failed" in both the cases but the comment is different.
Currently we use status to check for api limit, better would be to also add a check on comment

@dev-ritik
Copy link
Member

And what about the HTTP status code? I believe they will be different. Rather than matching for the comment, it would be better to check for status code in this case.

@Arnesh07
Copy link
Member

@prateek2211 Iss error ka response code toh 400 hai, do you know dusre waale ka kya hai?

@prateek2211
Copy link
Member Author

I don't really remember it, you could write a loop and cross the limit to see the status code

@prateek2211
Copy link
Member Author

@Arnesh07 Is this issue resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants