Skip to content

fix: settings - #1799

Merged
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/setting
Sep 14, 2025
Merged

fix: settings#1799
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/setting

Conversation

@seefs001

@seefs001 seefs001 commented Sep 14, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor

    • Unified system settings handling across worker requests, user notifications, and webhooks for consistency.
    • Standardized enablement checks and key validation to reduce configuration drift.
    • Streamlined internal configuration references without altering workflows.
  • Chores

    • General cleanup to improve maintainability and reduce duplication.
  • Notes

    • No user-facing behavior changes expected.

@coderabbitai

coderabbitai Bot commented Sep 14, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Refactors three service files to use the system_setting package instead of setting. All references to worker-related configuration (EnableWorker, WorkerUrl, WorkerValidKey, WorkerAllowHttpImageRequestEnabled) are updated accordingly. No functional logic, signatures, or public APIs are changed.

Changes

Cohort / File(s) Summary
Settings import refactor
service/cf_worker.go, service/user_notify.go, service/webhook.go
Replace import one-api/setting with one-api/setting/system_setting and update all references: EnableWorker(), WorkerUrl, WorkerValidKey, WorkerAllowHttpImageRequestEnabled. No other logic or signatures changed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Svc as Service (cf_worker/user_notify/webhook)
  participant Sys as system_setting
  participant Wkr as Worker Proxy
  participant Ext as External Endpoint

  Svc->>Sys: EnableWorker()
  alt worker enabled
    Svc->>Wkr: POST request (uses WorkerUrl, WorkerValidKey)
    Wkr->>Ext: Forward request
    Ext-->>Wkr: Response
    Wkr-->>Svc: Response
  else direct path
    Svc->>Ext: Direct HTTP request
    Ext-->>Svc: Response
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Fix/veo3 #1795 — Similar refactor switching from setting to system_setting for shared configuration, including worker flags and URLs.

Poem

I tweaked the knobs behind the scene,
Hopped from setting to system_setting clean.
Keys in paw, URLs aligned,
Worker burrows well-defined.
With whiskers twitching, I declare:
Same paths, new warren, handled with care. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d71f46 and 8563eaf.

📒 Files selected for processing (3)
  • service/cf_worker.go (3 hunks)
  • service/user_notify.go (2 hunks)
  • service/webhook.go (2 hunks)

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.

@Calcium-Ion
Calcium-Ion merged commit 4f760a8 into QuantumNous:main Sep 14, 2025
1 check was pending
x22x22 pushed a commit to x22x22/new-api that referenced this pull request Apr 24, 2026
jiutubaba pushed a commit to jiutubaba/fx-api that referenced this pull request May 17, 2026
…tity-foundation

fix(auth,payment,profile): 修复认证身份和支付系统的后续问题
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