Skip to content

Conversation

@cursor
Copy link

@cursor cursor bot commented Nov 21, 2025

Adds per-request caching for user potato statistics to eliminate redundant SUM queries.

The potatoSentToday and potatoLeftToday methods were executing identical database queries multiple times within a single request. This change introduces a lightweight cache on the User entity, ensuring these methods only query the daily potato count once per request and potatoLeftToday derives its value from the cached potatoSentToday result.


Open in Cursor Open in Web

@cursor
Copy link
Author

cursor bot commented Nov 21, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@codecov
Copy link

codecov bot commented Nov 21, 2025

Bundle Report

Bundle size has no change ✅

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.04%. Comparing base (b6005c8) to head (0f95e26).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #364      +/-   ##
============================================
- Coverage     26.20%   26.04%   -0.16%     
- Complexity      323      324       +1     
============================================
  Files            77       77              
  Lines          3247     3240       -7     
============================================
- Hits            851      844       -7     
  Misses         2396     2396              

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

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