Configurable background task execution

This commit is contained in:
Lorenzo Bolla
2021-09-08 15:50:54 +02:00
parent bd4c3a246d
commit 9b28d8984f
18 changed files with 427 additions and 214 deletions
+3 -1
View File
@@ -2,6 +2,7 @@ package task
import (
"fmt"
"github.com/aptly-dev/aptly/aptly"
"sync"
)
@@ -138,10 +139,11 @@ func (list *List) RunTaskInBackground(name string, resources []string, process P
}
list.Unlock()
err := process(task.output, task.detail)
retCode, err := process(aptly.Progress(task.output), task.detail)
list.Lock()
{
task.processReturnCode = retCode
if err != nil {
task.output.Printf("Task failed with error: %v", err)
task.State = FAILED