feat: move schedules to registered workers
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -39,6 +39,7 @@ func NewExecutor(
|
||||
}
|
||||
|
||||
func (e *Executor) DispatchEvents(ctx context.Context) error {
|
||||
|
||||
e.logger.InfoContext(ctx, "dispatching events")
|
||||
|
||||
start := time.Now().Add(-time.Second * 30)
|
||||
@@ -54,6 +55,11 @@ func (e *Executor) DispatchEvents(ctx context.Context) error {
|
||||
return fmt.Errorf("failed to find workers: %w", err)
|
||||
}
|
||||
|
||||
e.logger.InfoContext(ctx, "moving unattended events")
|
||||
if err := e.workerscheduler.GetUnattended(ctx, registeredWorkers); err != nil {
|
||||
return fmt.Errorf("failed to move unattended events: %w", err)
|
||||
}
|
||||
|
||||
workers, err := e.workerscheduler.GetWorkers(ctx, registeredWorkers)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to find workers: %w", err)
|
||||
|
Reference in New Issue
Block a user