mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
queue sync calls
This commit is contained in:
12
task/list.go
12
task/list.go
@@ -56,6 +56,7 @@ func (list *List) consumer() {
|
||||
list.Lock()
|
||||
{
|
||||
task.processReturnValue = retValue
|
||||
task.err = err
|
||||
if err != nil {
|
||||
task.output.Printf("Task failed with error: %v", err)
|
||||
task.State = FAILED
|
||||
@@ -241,3 +242,14 @@ func (list *List) WaitForTaskByID(ID int) (Task, error) {
|
||||
wgTask.Wait()
|
||||
return list.GetTaskByID(ID)
|
||||
}
|
||||
|
||||
// GetTaskError returns the Task error for a given id
|
||||
func (list *List) GetTaskErrorByID(ID int) (error, error) {
|
||||
task, err := list.GetTaskByID(ID)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return task.err, nil
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ type Task struct {
|
||||
detail *Detail
|
||||
process Process
|
||||
processReturnValue *ProcessReturnValue
|
||||
err error
|
||||
Name string
|
||||
ID int
|
||||
State State
|
||||
|
||||
Reference in New Issue
Block a user