MCPcopy Index your code
hub / github.com/aptly-dev/aptly / WaitForTaskByID

Method WaitForTaskByID

task/list.go:253–263  ·  view source on GitHub ↗

WaitForTaskByID waits for task with given id to be processed

(ID int)

Source from the content-addressed store, hash-verified

251
252// WaitForTaskByID waits for task with given id to be processed
253func (list *List) WaitForTaskByID(ID int) (Task, error) {
254 list.Lock()
255 wgTask, ok := list.wgTasks[ID]
256 list.Unlock()
257 if !ok {
258 return Task{}, fmt.Errorf("could not find task with id %v", ID)
259 }
260
261 wgTask.Wait()
262 return list.GetTaskByID(ID)
263}
264
265// GetTaskErrorByID returns the Task error for a given id
266func (list *List) GetTaskErrorByID(ID int) (error, error) {

Callers 3

TestListMethod · 0.95
maybeRunTaskInBackgroundFunction · 0.80
apiTasksWaitForTaskByIDFunction · 0.80

Calls 2

GetTaskByIDMethod · 0.95
WaitMethod · 0.80

Tested by 1

TestListMethod · 0.76