Skip to content

perf: concurrent quota refresh for all accounts#354

Closed
Mag1cFall wants to merge 1 commit intolbjlaq:mainfrom
Mag1cFall:perf/concurrent-quota-refresh
Closed

perf: concurrent quota refresh for all accounts#354
Mag1cFall wants to merge 1 commit intolbjlaq:mainfrom
Mag1cFall:perf/concurrent-quota-refresh

Conversation

@Mag1cFall
Copy link
Contributor

Changes

Refactored refresh_all_quotas command from sequential to concurrent execution using futures::future::join_all.

  • Used futures::future::join_all to spawn concurrent async tasks
  • Each account's quota fetch and save operations run in parallel
  • Preserved original filtering logic (skip disabled/forbidden accounts)
  • Preserved error handling and logging per account

Safety Analysis

The original code had a comment: // 串行处理以确保持久化安全 (SQLite)

This comment is legacy/outdated. Current storage implementation:

// save_account function
let account_path = accounts_dir.join(format!("{}.json", account.id));
fs::write(&account_path, content)

Each account is stored in a separate JSON file ({account_id}.json), not SQLite. Concurrent writes to different files are completely safe - no race conditions or data corruption possible.

@lbjlaq
Copy link
Owner

lbjlaq commented Jan 7, 2026

感谢您的贡献!🎉

此 PR 的更改已被手动集成到 v3.3.16 版本中。

相关更新已包含在以下文件中:

  • README.md 的版本更新日志
  • 贡献者列表

再次感谢您对 Antigravity Tools 项目的支持!


Thank you for your contribution! 🎉

The changes from this PR have been manually integrated into v3.3.16.

The updates are documented in:

  • README.md changelog
  • Contributors list

Thank you again for your support of the Antigravity Tools project!

@lbjlaq
Copy link
Owner

lbjlaq commented Jan 7, 2026

已集成到 v3.3.16,关闭此 PR。

@lbjlaq lbjlaq closed this Jan 7, 2026
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