updateStatus 更新任务状态(通用)
(taskID string, updater func(*TaskStatus))
| 270 | |
| 271 | // updateStatus 更新任务状态(通用) |
| 272 | func (e *LongRunningExecutor) updateStatus(taskID string, updater func(*TaskStatus)) error { |
| 273 | value, ok := e.tasks.Load(taskID) |
| 274 | if !ok { |
| 275 | return fmt.Errorf("task not found: %s", taskID) |
| 276 | } |
| 277 | |
| 278 | status := value.(*TaskStatus) |
| 279 | updater(status) |
| 280 | e.tasks.Store(taskID, status) |
| 281 | |
| 282 | return nil |
| 283 | } |
| 284 | |
| 285 | // copyMetadata 复制元数据 |
| 286 | func copyMetadata(src map[string]any) map[string]any { |
no test coverage detected