Skip to content

Cache leaderboard endpoints with lifecycle invalidation - #386

Open
silentgeckoaudit3801 wants to merge 6 commits into
Quantarq:mainfrom
silentgeckoaudit3801:perf/cache-leaderboard-238
Open

Cache leaderboard endpoints with lifecycle invalidation#386
silentgeckoaudit3801 wants to merge 6 commits into
Quantarq:mainfrom
silentgeckoaudit3801:perf/cache-leaderboard-238

Conversation

@silentgeckoaudit3801

Copy link
Copy Markdown

Closes #238.

Summary

  • cache /api/get-user-leaderboard and /api/get-position-tokens-statistic behind short-lived Redis keys
  • add best-effort synchronous leaderboard cache invalidation for position lifecycle hooks
  • invalidate leaderboard aggregates after position open, close, and liquidation updates
  • add static coverage for endpoint cache wiring and lifecycle invalidation wiring

Validation

  • Parsed the changed Python files with ast.parse using the bundled Codex Python runtime.
  • GitHub compare reports this branch is 0 commits behind main.

Testing

  • Not run as a project test suite because this workspace is avoiding dependency installation and project toolchain execution.

Comment thread quantara/web_app/api/leaderboard.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
Comment thread quantara/web_app/tests/test_leaderboard_cache_static.py Fixed
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.

Cache leaderboard with manual invalidation

2 participants