(plan, extraState = {})
| 3877 | } |
| 3878 | |
| 3879 | async function persistAutoRunTimerPlan(plan, extraState = {}) { |
| 3880 | const normalizedPlan = normalizeAutoRunTimerPlan(plan); |
| 3881 | if (!normalizedPlan) { |
| 3882 | throw new Error('自动运行计时计划无效。'); |
| 3883 | } |
| 3884 | |
| 3885 | const statusPayload = getAutoRunTimerStatusPayload(normalizedPlan); |
| 3886 | await broadcastAutoRunStatus( |
| 3887 | statusPayload.phase, |
| 3888 | statusPayload, |
| 3889 | { |
| 3890 | ...extraState, |
| 3891 | autoRunTimerPlan: normalizedPlan, |
| 3892 | scheduledAutoRunPlan: null, |
| 3893 | } |
| 3894 | ); |
| 3895 | await ensureAutoRunTimerAlarm(normalizedPlan.fireAt); |
| 3896 | return normalizedPlan; |
| 3897 | } |
| 3898 | |
| 3899 | function getAutoRunTimerResumeOptions(plan) { |
| 3900 | const normalizedPlan = normalizeAutoRunTimerPlan(plan); |
no test coverage detected