()
| 5158 | } |
| 5159 | |
| 5160 | async function resumeAutoRun() { |
| 5161 | throwIfStopped(); |
| 5162 | const state = await getState(); |
| 5163 | if (!state.email) { |
| 5164 | await addLog('无法继续:当前没有邮箱地址,请先在侧边栏填写邮箱。', 'error'); |
| 5165 | return false; |
| 5166 | } |
| 5167 | |
| 5168 | const resumedInMemory = await resumeAutoRunIfWaitingForEmail({ silent: true }); |
| 5169 | if (resumedInMemory) { |
| 5170 | return true; |
| 5171 | } |
| 5172 | |
| 5173 | if (!isAutoRunPausedState(state)) { |
| 5174 | return false; |
| 5175 | } |
| 5176 | |
| 5177 | if (autoRunActive) { |
| 5178 | return false; |
| 5179 | } |
| 5180 | |
| 5181 | const totalRuns = state.autoRunTotalRuns || 1; |
| 5182 | const currentRun = state.autoRunCurrentRun || 1; |
| 5183 | const attemptRun = state.autoRunAttemptRun || 1; |
| 5184 | |
| 5185 | await addLog('检测到自动流程暂停上下文已丢失,正在从当前进度恢复自动运行...', 'warn'); |
| 5186 | startAutoRunLoop(totalRuns, { |
| 5187 | autoRunSkipFailures: Boolean(state.autoRunSkipFailures), |
| 5188 | mode: 'continue', |
| 5189 | resumeCurrentRun: currentRun, |
| 5190 | resumeAttemptRun: attemptRun, |
| 5191 | resumeRoundSummaries: state.autoRunRoundSummaries, |
| 5192 | }); |
| 5193 | return true; |
| 5194 | } |
| 5195 | |
| 5196 | // ============================================================ |
| 5197 | // Signup / OAuth Helpers |
no test coverage detected