chore: better defaults for parallel jobs (#76)

* chore: better defaults for parallel jobs

Signed-off-by: mudler <mudler@localai.io>

* chore(tests): add timeout

---------

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2025-04-23 00:12:44 +02:00
committed by GitHub
parent 25bb3fb123
commit 56cd0e05ca
3 changed files with 8 additions and 2 deletions

View File

@@ -990,7 +990,6 @@ func (a *Agent) periodicallyRun(timer *time.Timer) {
}
func (a *Agent) Run() error {
a.startNewConversationsConsumer()
xlog.Debug("Agent is now running", "agent", a.Character.Name)
// The agent run does two things:
@@ -1013,7 +1012,12 @@ func (a *Agent) Run() error {
var muErr sync.Mutex
var wg sync.WaitGroup
for i := 0; i <= a.options.parallelJobs; i++ {
parallelJobs := a.options.parallelJobs
if a.options.parallelJobs == 0 {
parallelJobs = 1
}
for i := 0; i < parallelJobs; i++ {
xlog.Debug("Starting agent worker", "worker", i)
wg.Add(1)
go func() {