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

Method ListTasks

pkg/tools/builtin/task_manager.go:304–318  ·  view source on GitHub ↗

ListTasks 列出所有任务

()

Source from the content-addressed store, hash-verified

302
303// ListTasks 列出所有任务
304func (tm *FileTaskManager) ListTasks() ([]*TaskInfo, error) {
305 tm.mu.RLock()
306 defer tm.mu.RUnlock()
307
308 tasks := make([]*TaskInfo, 0, len(tm.tasks))
309 for _, task := range tm.tasks {
310 // 更新运行中任务的状态
311 if task.Status == "running" {
312 tm.updateTaskStatus(task)
313 }
314 tasks = append(tasks, task)
315 }
316
317 return tasks, nil
318}
319
320// GetTaskStatus 获取任务状态
321func (tm *FileTaskManager) GetTaskStatus(taskID string) (string, error) {

Callers

nothing calls this directly

Calls 1

updateTaskStatusMethod · 0.95

Tested by

no test coverage detected