Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Late start times cause games to be missed #12

Closed
AdmaJonse opened this issue Apr 15, 2022 · 2 comments · Fixed by #22, #25 or #27
Closed

Late start times cause games to be missed #12

AdmaJonse opened this issue Apr 15, 2022 · 2 comments · Fixed by #22, #25 or #27

Comments

@AdmaJonse
Copy link
Owner

When we run in a container, the system uses UTC time (midnight UTC corresponds to 8:00 PM eastern). This means that when we start the container and query the date to determine if there's a game today, we may actually be querying the wrong date.

The NHL API uses UTC for time stamps in their game data, however, the "date" field in a schedule query considers games that start after midnight UTC to still be part of the previous day.

I think the simplest way to deal with this is to simply apply an offset when checking for games on a given date. The latest we ever see a game start is around 10:30 PM EST (or 3:30 UTC on the next day). To be safe, we could simply convert the UTC time to EST prior to getting the date.

@AdmaJonse
Copy link
Owner Author

Applying an offset has mostly resolved this issue as described. However, there's a new issue that occurs when continuing after game parsing has completed.

The expected behaviour is that once we encounter a game over event, we kill parsing of the current game and return to our main loop. This is supposed to trigger a pause until noon on the following day, at which point we're supposed to determine whether there is a game on that day (if there is, we'll wait until the start time then parse; if there's not, we'll wait until noon on the following day).

Instead, the application indicates that there is no game regardless of whether there actually is one or not. If we simply restart the application, it correctly identifies that there is a game that day. This seems to indicate that we may not be checking the correct day during such continuations. More investigation is required here.

@AdmaJonse
Copy link
Owner Author

I think this might fix it. Need to wait for a game day to test this though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant