Skip to content

Commit 28917bd

Browse files
execute agent tasks in goroutines (#216)
* execute agent tasks in goroutines
1 parent f662973 commit 28917bd

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

venona/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.14
1+
1.5.15

venona/pkg/agent/agent.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ var (
5151
const (
5252
defaultTaskPullingInterval = time.Second * 3
5353
defaultStatusReportingInterval = time.Second * 10
54-
defaultProxyRequestTimeout = time.Second * 60
55-
defaultProxyRequestRetries = 5
54+
defaultProxyRequestTimeout = time.Second * 30
55+
defaultProxyRequestRetries = 3
5656
)
5757

5858
type (
@@ -264,11 +264,14 @@ func startTasks(tasks []task.Task, runtimes map[string]runtime.Runtime, logger l
264264
t := agentTasks[i]
265265
logger.Info("executing agent task", "tid", t.Metadata.Workflow)
266266
txn := newTransaction(monitor, t.Type, t.Metadata.Workflow, t.Metadata.ReName)
267-
if err := executeAgentTask(&t, logger); err != nil {
268-
logger.Error(err.Error())
269-
noticeError(txn, err, logger)
270-
}
271-
endTransaction(txn, logger)
267+
go func(tid string) {
268+
if err := executeAgentTask(&t, logger); err != nil {
269+
logger.Error(err.Error())
270+
noticeError(txn, err, logger)
271+
}
272+
endTransaction(txn, logger)
273+
logger.Info("finished agent task", "tid", t.Metadata.Workflow)
274+
}(t.Metadata.Workflow)
272275
}
273276

274277
// process creation tasks

venonactl/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.14
1+
1.5.15

0 commit comments

Comments
 (0)