fix(power): reschedule idle tasks#94
Conversation
1. Query the current idle state from IdleWatcher when updating the power save plan. 2. Recalculate task delays differently when the session is already idle. 3. Drop the duplicated PowerSavePlan idle state to avoid stale scheduling decisions. Log: Reschedule power save tasks correctly when the idle state is already active. fix(power): 修复 idle 任务重排 1. 更新节能计划时从 IdleWatcher 查询当前 idle 状态。 2. 会话已处于 idle 状态时按任务自身延迟重新计算定时任务。 3. 移除 PowerSavePlan 重复维护的 idle 状态,避免使用过期状态调度任务。 Log: 已处于 idle 状态时正确重排节能任务。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 void PowerSavePlan::scheduleTask(const MetaTask &t)
{
// 使用 qInfo 替代 qWarning,避免正常调度流程污染警告日志
qInfo(logPowerSession) << "Scheduling task" << t.name << "to run in" << t.realDelay << "ms";
auto *timer = new QTimer(this);
timer->setSingleShot(true);
connect(timer, &QTimer::timeout, this, t.fn);
// 后续逻辑...
} |
Log: Reschedule power save tasks correctly when the idle state is already active.
fix(power): 修复 idle 任务重排
Log: 已处于 idle 状态时正确重排节能任务。