Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This small rewrite adds a new
utilfunction namedgetNumberFromRedirect. It's implementation is fairly simple, it fetches the provided URL (to be used with 'https://start.gg/<tournament_name>') and specifically follows a redirect. Start.gg will take the user to the most recent week of a tournament if only a name is provided. For example, this is the 158th week of alulu, so visiting start.gg/alulu will redirect you to the start.gg/alulu-158.After updating the bot to use Docker, I learned that files within a docker container aren't updated. So my original solution to finding the most recent tournament (because start.gg's API doesn't offer a simple way to do this), was to store the week count in a file named
WEEK_COUNT.txtand at the end of the process ofjobs/index, increment the number stored in this value for the following week.Alternatively, I could have created a volume for
WEEK_COUNT.txtsuch that it's value is updated and persisted from week to week but it seems better to instead move away from a less than stellar solution rather than working around this.