Skip to content
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

fix: check correct ETS table for stop state last updated #836

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

lemald
Copy link
Member

@lemald lemald commented Oct 10, 2024

Summary of changes

Asana Ticket: 🍎 Look into /stops updating too frequently in v3 API /status endpoint

Upon examination, it turned out that the Stop state is implemented a bit differently from most of the other states, in that the process that actually use-es State.Server and tracks the state in an ETS table isn't State.Stop but State.Stop.Cache. The State.Metadata.last_updates/1 function returns the result of DateTime.utc_now/0 if no timestamp is found in ETS, so because we were looking for the last updated time of the wrong module we were always getting the current time.

@lemald lemald requested review from a team and jzimbel-mbta and removed request for a team October 10, 2024 15:54
Copy link

Coverage of commit 18ec2e1

Summary coverage rate:
  lines......: 89.1% (4231 of 4750 lines)
  functions..: 70.2% (2284 of 3255 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/state/lib/state/metadata.ex                                      |90.0%     30|90.9%    11|    -      0

Download coverage report

@lemald lemald force-pushed the lem-fix-stop-status-timestamp branch from 18ec2e1 to 135ef18 Compare October 10, 2024 19:48
Copy link

Coverage of commit 135ef18

Summary coverage rate:
  lines......: 89.1% (4232 of 4751 lines)
  functions..: 70.2% (2285 of 3257 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/state/lib/state/metadata.ex                                      |90.0%     30|90.9%    11|    -      0

Download coverage report

@lemald lemald merged commit af73ff4 into master Oct 11, 2024
18 checks passed
@lemald lemald deleted the lem-fix-stop-status-timestamp branch October 11, 2024 14:20
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.

3 participants