feat: wire configured harness execution
This commit is contained in:
@@ -31,6 +31,7 @@ type Router struct {
|
||||
Now func() time.Time
|
||||
backoff map[string]time.Time
|
||||
attempts map[string]int
|
||||
OnLease func(domain.Event) error
|
||||
}
|
||||
|
||||
func (r *Router) init() {
|
||||
@@ -99,6 +100,11 @@ func (r *Router) AssignPending() ([]domain.Event, error) {
|
||||
}
|
||||
r.attempts[t.ID]++
|
||||
out = append(out, e)
|
||||
if r.OnLease != nil {
|
||||
if err := r.OnLease(e); err != nil {
|
||||
return out, err
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user