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

editoast: fix train schedule projection cache #8954

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

flomonster
Copy link
Contributor

The train projections retrieve in redis were associated with a random train id.

close #8952

@flomonster flomonster requested a review from a team as a code owner September 20, 2024 17:36
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 37.20%. Comparing base (a7da946) to head (ed886d0).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
editoast/src/views/train_schedule/projection.rs 0.00% 14 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##                dev    #8954   +/-   ##
=========================================
  Coverage     37.20%   37.20%           
  Complexity     2245     2245           
=========================================
  Files          1260     1260           
  Lines        115364   115368    +4     
  Branches       3267     3267           
=========================================
+ Hits          42920    42923    +3     
- Misses        70498    70499    +1     
  Partials       1946     1946           
Flag Coverage Δ
core 74.79% <ø> (ø)
editoast 72.57% <0.00%> (+<0.01%) ⬆️
front 15.18% <ø> (ø)
gateway 2.20% <ø> (ø)
osrdyne 2.60% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@woshilapin woshilapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh, the randomness of HashMap, always a little trick that comes back to bite you. Note: would a different Hasher (see https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.with_hasher) avoid this randomness, so you can keep the previous version of the code?

editoast/src/views/train_schedule/projection.rs Outdated Show resolved Hide resolved
@flomonster
Copy link
Contributor Author

Ahhhh, the randomness of HashMap, always a little trick that comes back to bite you. Note: would a different Hasher (see https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.with_hasher) avoid this randomness, so you can keep the previous version of the code?

I can probably find another hash function to avoid randomness. However, I prefer to use indexing for readability reasons.

The train projections retrieve in redis were associated with a random train id.

Signed-off-by: Florian Amsallem <[email protected]>
@flomonster flomonster added this pull request to the merge queue Sep 24, 2024
Merged via the queue into dev with commit a728475 Sep 24, 2024
23 checks passed
@flomonster flomonster deleted the fam/fix-train-projects-cache branch September 24, 2024 08:25
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.

front: missing trains in space-time chart
4 participants