Skip to content

Remove disabled meta cache refresh setup#105

Open
kingpy-bot wants to merge 1 commit into
KoalaBotUK:mainfrom
kingpy-bot:kingpy/remove-disabled-meta-cache-33
Open

Remove disabled meta cache refresh setup#105
kingpy-bot wants to merge 1 commit into
KoalaBotUK:mainfrom
kingpy-bot:kingpy/remove-disabled-meta-cache-33

Conversation

@kingpy-bot

@kingpy-bot kingpy-bot commented Jul 5, 2026

Copy link
Copy Markdown

Summary

This removes the disabled meta cache refresh setup path from the API.

The previous startup path called setup(...), then meta::setup(...), then guilds::setup(...), which logged that a meta cache refresh task was spawning. The actual task was permanently guarded behind if false, so no background refresh could run. This patch removes that unreachable setup path and the now-unused imports/helpers around it.

Closes #33.

Scope

  • Removes the unused startup setup call path.
  • Removes the disabled refresh_meta_cache(...) loop.
  • Removes unused imports for the prime-cache helpers, tracing levels, time math, and tokio::time sleep.
  • Leaves the existing /meta/guilds and /meta/guilds/{guild_id} handlers unchanged.

Local checks

  • git -c core.whitespace=trailing-space,space-before-tab,cr-at-eol diff --check HEAD~1..HEAD: pass
  • Residual grep for removed setup/cache symbols in touched files: pass

Not run locally: cargo check -p api and cargo fmt --check, because this host does not have cargo/rustfmt installed. CI or a Rust-equipped environment should confirm before merge.

AI-assisted disclosure: I used an AI coding agent to prepare this cleanup patch and validation notes.

Summary by CodeRabbit

  • Refactor

    • Simplified service startup and metadata routing setup.
    • Removed background metadata cache refresh work, reducing unnecessary startup/background activity.
  • Bug Fixes

    • Kept existing API routes and response behavior intact while streamlining initialization.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 634684ed-f52a-4b68-a6b9-f99c70fb8a49

📥 Commits

Reviewing files that changed from the base of the PR and between 72ea88f and 428dc18.

📒 Files selected for processing (3)
  • api/src/main.rs
  • api/src/meta/guilds.rs
  • api/src/meta/mod.rs
💤 Files with no reviewable changes (2)
  • api/src/meta/mod.rs
  • api/src/main.rs

📝 Walkthrough

Walkthrough

This change removes dead code related to a disabled meta cache refresh background task. It deletes setup functions in main.rs and meta/mod.rs, removes the refresh_meta_cache loop in meta/guilds.rs, and prunes unused imports across these files.

Changes

Dead Meta Cache Refresh Removal

Layer / File(s) Summary
Remove refresh_meta_cache loop and imports
api/src/meta/guilds.rs
Deletes the refresh_meta_cache async loop that continuously refreshed/primed meta caches, and removes now-unused cache-refresh and time/ops imports, narrowing tracing imports to warn only.
Remove meta::setup wiring
api/src/meta/mod.rs
Deletes the public setup(discord_bot: Arc<Client>) function that spawned the meta cache refresh task, and removes now-unused info, Arc, and twilight_http::Client imports.
Remove main.rs setup call and helper
api/src/main.rs
Removes the setup(app_state.discord_bot.clone()) call after AppState initialization and deletes the local setup helper function that forwarded to meta::setup.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing the disabled meta cache refresh setup.
Linked Issues check ✅ Passed The PR removes the unreachable setup and refresh loop, along with related cache-priming imports, matching issue #33.
Out of Scope Changes check ✅ Passed The changes stay focused on deleting the dead meta cache refresh path and related unused code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

[api] Dead code: refresh_meta_cache is gated behind if false, plus unreachable meta cache-priming path

1 participant