-
Notifications
You must be signed in to change notification settings - Fork 57
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
aoc runner sends requests to advent of code even if solution file does not exist #156
Comments
You're right about the underlying cause of the rate-limiter tripping. The problem is this plugin is indicating that it is succeeding (by returning a value at all) and the runner will assume you are returning at least one valid answer. You have an easy fix available which is to just remove the try/except from the entry point. The runner already has special handling for when the entry point raises exception, and it won't go looking for pre-existing answers in that case. So I'd recommend to change your function like this:
There will still be a WARNING about part B being unfinished when you're part-way through a puzzle (2014/11 here), but you shouldn't trip the rate limiter for the subsequent unsolved puzzles (2014/12+). It only goes looking for answers on the web page if it thinks it has some answer to compare with. Still, the suggestion to avoid hitting the server by skipping when an entry-point is "successfully" returning non-answers is a good one, that has been implemented in #157. I won't release this until January, but feel free to install directly from main branch and let me know if that works as expected! |
Thanks for your suggestion! Makes a lot of sense why it works that way. Love your project btw, I think it abstracts all the right parts of AOC so people can just focus on writing code. |
I appreciate the kind words. |
What I think is happening is even if there is a non-answer provided, the library is still trying to fetch the answer from AOC. However, if the problem isn't solved yet then the runner has nothing to cache, so this behavior repeats. Additionally, if several solutions are missing, this fires off the rate limiter, which quickly maxes out. I believe this behavior shouldn't be the default. Maybe missing solutions, which are already well-handled, should trigger a
skipped
orerror
state, and continue instead of trying to fetch a solution. Below is my entry point and console logs:The text was updated successfully, but these errors were encountered: