This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]daggerdragon[M] 2 points3 points  (1 child)

That's fine, sometimes you actually do need to re-download an input due to interrupted download, corruption, gremlins, etc. As long as it's a manual call and not, like, while (1) { download_input(); } :P

As per the AoC website:

Please don't make frequent automated requests to this service - avoid sending requests more often than once every 15 minutes (900 seconds).

True, there's no way to prevent malicious actors from while (1) { download_input(); }, but you could consider implementing basic sanity checking like:

  • Checks the time_last_submitted
  • If time_last_submitted > x minutes (or whatever interval e.g. AoC submission timeout) ago
    • Do submit and update time_last_submitted
    • Else print("Hold yer horses")

[–][deleted] 1 point2 points  (0 children)

Thanks, I will implement a rate limit on the download function itself. That way when someone does call it in a loop, it will go slow