summaryrefslogtreecommitdiff
path: root/internal/executor/executor.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/executor/executor.go')
-rw-r--r--internal/executor/executor.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go
index 7513916..972c254 100644
--- a/internal/executor/executor.go
+++ b/internal/executor/executor.go
@@ -60,7 +60,8 @@ type Pool struct {
runners map[string]Runner
store Store
logger *slog.Logger
- depPollInterval time.Duration // how often waitForDependencies polls; defaults to 5s
+ depPollInterval time.Duration // how often waitForDependencies polls; defaults to 5s
+ requeueDelay time.Duration // how long to wait before requeuing a blocked-per-agent task; defaults to 30s
mu sync.Mutex
active int
@@ -94,6 +95,7 @@ func NewPool(maxConcurrent int, runners map[string]Runner, store Store, logger *
store: store,
logger: logger,
depPollInterval: 5 * time.Second,
+ requeueDelay: 30 * time.Second,
activePerAgent: make(map[string]int),
rateLimited: make(map[string]time.Time),
cancels: make(map[string]context.CancelFunc),
@@ -574,7 +576,7 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) {
}
if p.activePerAgent[agentType] >= p.maxPerAgent {
p.mu.Unlock()
- time.AfterFunc(30*time.Second, func() { p.workCh <- workItem{ctx: ctx, task: t} })
+ time.AfterFunc(p.requeueDelay, func() { p.workCh <- workItem{ctx: ctx, task: t} })
return
}
if deadline, ok := p.rateLimited[agentType]; ok && time.Now().After(deadline) {