MCPcopy Create free account
hub / github.com/astercloud/aster / GetTask

Method GetTask

pkg/tools/builtin/task_manager.go:205–220  ·  view source on GitHub ↗

GetTask 获取任务信息

(taskID string)

Source from the content-addressed store, hash-verified

203
204// GetTask 获取任务信息
205func (tm *FileTaskManager) GetTask(taskID string) (*TaskInfo, error) {
206 tm.mu.RLock()
207 defer tm.mu.RUnlock()
208
209 task, exists := tm.tasks[taskID]
210 if !exists {
211 return nil, fmt.Errorf("task not found: %s", taskID)
212 }
213
214 // 更新任务状态
215 if task.Status == "running" {
216 tm.updateTaskStatus(task)
217 }
218
219 return task, nil
220}
221
222// GetTaskOutput 获取任务输出
223func (tm *FileTaskManager) GetTaskOutput(taskID string, filter string, lines int) (string, string, error) {

Callers 2

GetTaskOutputMethod · 0.95
GetTaskStatusMethod · 0.95

Calls 1

updateTaskStatusMethod · 0.95

Tested by

no test coverage detected