ResumeExecution 恢复执行
(executionID string)
| 292 | |
| 293 | // ResumeExecution 恢复执行 |
| 294 | func (e *Engine) ResumeExecution(executionID string) error { |
| 295 | e.executionsMu.RLock() |
| 296 | execution, exists := e.executions[executionID] |
| 297 | e.executionsMu.RUnlock() |
| 298 | |
| 299 | if !exists { |
| 300 | return fmt.Errorf("execution not found: %s", executionID) |
| 301 | } |
| 302 | |
| 303 | execution.mu.Lock() |
| 304 | defer execution.mu.Unlock() |
| 305 | |
| 306 | if execution.Status != StatusPaused { |
| 307 | return fmt.Errorf("execution is not paused: %s", execution.Status) |
| 308 | } |
| 309 | |
| 310 | execution.Status = StatusRunning |
| 311 | |
| 312 | // 恢复执行 |
| 313 | go e.continueExecution(execution) |
| 314 | |
| 315 | return nil |
| 316 | } |
| 317 | |
| 318 | // ListExecutions 列出执行记录 |
| 319 | func (e *Engine) ListExecutions(workflowID string, status WorkflowStatus, limit int) ([]*WorkflowExecution, error) { |
nothing calls this directly
no test coverage detected