Skip to content

fix(cache): remove unused get_current_rate_limit function#277

Open
ojaswa072 wants to merge 1 commit intoOWASP-BLT:mainfrom
ojaswa072:fix/remove-dead-get-current-rate-limit
Open

fix(cache): remove unused get_current_rate_limit function#277
ojaswa072 wants to merge 1 commit intoOWASP-BLT:mainfrom
ojaswa072:fix/remove-dead-get-current-rate-limit

Conversation

@ojaswa072
Copy link
Copy Markdown
Contributor

@ojaswa072 ojaswa072 commented Mar 9, 2026

Summary

Removed dead get_current_rate_limit() function from cache.py.

Problem

get_current_rate_limit() was defined in cache.py but never imported or called anywhere in the codebase. The actually-used function is get_rate_limit_cache(), which is correctly imported in both handlers.py and github_api.py.

Having dead code creates confusion about which function to use for rate limit access.

Fix

Deleted the unused get_current_rate_limit() function (11 lines). get_rate_limit_cache() remains untouched.

Files Changed

  • src/cache.py — removed 11 lines (dead function)

Summary by CodeRabbit

  • Refactor
    • Simplified internal rate limit cache access patterns by consolidating helper functions.

@owasp-blt
Copy link
Copy Markdown

owasp-blt bot commented Mar 9, 2026

👋 Thanks for opening this pull request, @ojaswa072!

Before your PR is reviewed, please ensure:

  • Your code follows the project's coding style and guidelines.
  • You have written or updated tests for your changes.
  • The commit messages are clear and descriptive.
  • You have linked any relevant issues (e.g., Closes #123).

🔍 Our team will review your PR shortly. If you have questions, feel free to ask in the comments.

🚀 Keep up the great work! — OWASP BLT

@owasp-blt
Copy link
Copy Markdown

owasp-blt bot commented Mar 9, 2026

📊 Monthly Leaderboard

Hi @ojaswa072! Here's how you rank for March 2026:

Rank User Open PRs PRs (merged) PRs (closed) Reviews Comments Total
🥇 #1 @Nachiket-Roy 6 47 13 8 6 502
🥈 #2 @ojaswa072 12 30 0 0 1 314
#3 @e-esakman 2 26 0 6 4 300

Scoring this month (across OWASP-BLT org): Open PRs (+1 each), Merged PRs (+10), Closed (not merged) (−2), Reviews (+5; first two per PR in-month), Comments (+2, excludes CodeRabbit). Run /leaderboard on any issue or PR to see your rank!

@owasp-blt
Copy link
Copy Markdown

owasp-blt bot commented Mar 9, 2026

👋 Hi @ojaswa072!

This pull request needs a peer review before it can be merged. Please request a review from a team member who is not:

  • The PR author
  • coderabbitai
  • copilot

Once a valid peer review is submitted, this check will pass automatically. Thank you!

⚠️ Peer review enforcement is active.

@owasp-blt owasp-blt bot added the needs-peer-review PR needs peer review label Mar 9, 2026
@github-actions github-actions bot added the files-changed: 1 PR changes 1 file label Mar 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: OWASP-BLT/coderabbit/.coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 130615da-a0e4-4e11-a766-2b3a017402a4

📥 Commits

Reviewing files that changed from the base of the PR and between ee8eb8a and e5da7c6.

📒 Files selected for processing (1)
  • src/cache.py
💤 Files with no reviewable changes (1)
  • src/cache.py

Walkthrough

The PR removes a public helper function get_current_rate_limit() from the cache module. This function previously returned rate limit data (limit, remaining, reset) for frontend consumption. Control flow now relies exclusively on get_rate_limit_cache() for accessing rate limit information.

Changes

Cohort / File(s) Summary
Rate Limit Cache Helper Removal
src/cache.py
Deleted the get_current_rate_limit() public function that returned rate limit dictionary. No changes to underlying get_rate_limit_cache() or set_rate_limit_data() functions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

quality: low

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: removal of an unused function from the cache module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

🍃 PR Readiness Check

Check the readiness of this PR on Leaf:
👉 Open on Leaf

Leaf reviews pull requests for operational readiness, security risks, and production-impacting changes before they ship.

@owasp-blt owasp-blt bot added has-peer-review PR has received peer review and removed needs-peer-review PR needs peer review labels Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants