Skip to content

Conversation

@specificlanguage
Copy link
Owner

AWS Live Stats setup on ECS/Fargate.

Currently, only Dev environments are working. Things needed for a full dev deployment:

  • Change secrets manager information for prod
  • Create roles that will allow changing groups on Cloudwatch logs
  • Create the ECS stack for production
  • Create new prod Redis instance for live stats instead of using the dev instance

I'm currently putting it off until I'm actually ready to go for production on the entire Pick'em stack, but this pull request is pretty much just affirmation that it works. Github Actions is a little bit of trial and error.

When merging, please make sure you squash commits.

- We only want to actually create a new task definition to update the latest -- it will automatically be deployed by EventBridge Scheduler every time, therefore there is no need to launch a service.
… only

- We only want to actually create a new task definition to update the latest -- it will automatically be deployed by EventBridge Scheduler every time, therefore there is no need to launch a service.
@specificlanguage specificlanguage marked this pull request as draft March 7, 2024 03:25
- Adds handling for games of unknown type
- Adds code for "preview" or "pre-game" status

TODO: check if postponed or cancelled, and do accordingly
- Adds code specifically for games that are postponed or cancelled, due to rain or other circumstances
- Adds code specifically for games that are postponed or cancelled, due to rain or other circumstances
- Set homeScore and other information to null if not present
- Redo getGameType to cover all possible prefixes of MLB information
- Modify queries to work correctly and be clearer in the DB
- Calls MLB's statsapi to retrieve the schedule from the API for all games for the day
- Includes rescheduled games from previous days
- Updates database's start times when needed
- Adds simple batch job to set games that have been delayed already prior to job launch to be pushed onto the next day
- For postponed games that occur while in progress:
  - Update the time present in the database
  - Update the time present in the Redis cache
- To do (low prio): Prune all scheduled games currently in the cache and remove if the start time is less than a day away
@specificlanguage specificlanguage marked this pull request as ready for review April 4, 2024 00:05
@specificlanguage
Copy link
Owner Author

Note: will be swapping over to Google Cloud deployments in a bit, just wanted to reactivate the branch

- Retrieves all games currently in the database, retrieves their updated status once upon startup
- Allows completed games from the previous day (or instance of this job), if unresolved, to be cleaned in case of emergency
- Allows postponed games -- which were postponed on the day of -- to be rechecked when they were postponed to and updated within the database(s).
- Cache responses for longer than 10 minutes
- Will not last until next day if game is incomplete, mostly for development purposes
- Adds a precalculation about whether the home team wins the game
- Uses the precalculation in the queries, no longer relies on knowing the score or winner from other tables
- Date should not be set for Eastern time -- previously, times had been set for UTC which caused issues when loading in AWS

Resolves #2
- Date is now set to current date

Hopefully resolves #2
- Retrieving games from MLB should be correctly set to Eastern time zone specifically for this purpose

Once again, I hope this resolves #2
- Changes docker container to force Eastern time zone
- Reverts previous commit
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

Successfully merging this pull request may close these issues.

2 participants