feat: allow disabling API hot updates - #561
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #561 +/- ##
===========================================
- Coverage 72.05% 14.51% -57.54%
===========================================
Files 72 11 -61
Lines 6674 434 -6240
Branches 6674 434 -6240
===========================================
- Hits 4809 63 -4746
+ Misses 1523 370 -1153
+ Partials 342 1 -341 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks, the motivation is valid, and I think However, disabling the updater and handling automatic update failures are two separate concerns. Requiring users to disable the updater in advance only provides an opt-out; with the default configuration, a temporary API failure still prevents both normal runs and dry runs. I think the desired behavior should be:
|
Summary
hot_update.auto_update, defaulting totruefor backward compatibilitymaa hot-updatecommand unchangedMotivation
run_corecurrently calls the activity/API resource hot updater before every task, including--dry-run. Ifapi.maa.plusis unreachable or a connection is reset, task parsing and device automation abort before MaaCore can run. The existingresource.auto_updateoption only controls the Git-backed MaaResource updater, so it cannot disable these API requests.This was reproduced on Windows with maa-cli 0.7.5: both dry-run and a StartUp-only task failed during the API hot update. With this patch and
hot_update.auto_update = false, dry-run completes without an update request.Impact
Existing users keep the current behavior because the new setting defaults to
true. Users on offline or restricted networks can disable automatic API updates and runmaa hot-updateexplicitly when connectivity is available.Checks
cargo +nightly fmtcargo clippy -p maa-cli --all-targets --offlinecargo x test --no-core-tests --no-ignored-tests --package maa-cli(306 passed, 26 ignored)Summary by Sourcery
引入一个可配置的开关,用于控制自动活动/API 热更新,并将其接入任务执行流程,默认行为保持现有逻辑不变。
New Features:
hot_update.auto_updateCLI 配置项,用于在运行任务前启用或禁用活动和 API 资源的自动热更新。Enhancements:
Documentation:
hot_update.auto_update设置。Tests:
hot_update.auto_update字段及其默认值和显式配置值。Original summary in English
Summary by Sourcery
Introduce a configurable switch to control automatic activity/API hot updates and wire it into task execution, with defaults preserving existing behavior.
New Features:
Enhancements:
Documentation:
Tests: