Skip to content

Commit

Permalink
support multiple controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Apr 4, 2024
1 parent 911c746 commit 9ade2a3
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 88 deletions.
4 changes: 2 additions & 2 deletions backend/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func New(ctx context.Context, db *dal.DAL, config Config, runnerScaling scaling.
increaseReplicaFailures: map[string]int{},
}

cronSvc := cronjobs.New(ctx, cronjobs.Config{Timeout: config.CronJobTimeout}, db, svc.tasks, svc)
cronSvc := cronjobs.New(ctx, key, cronjobs.Config{Timeout: config.CronJobTimeout}, db, svc.tasks, svc)
svc.cronJobs = cronSvc

svc.tasks.Parallel(backoff.Backoff{Min: time.Second, Max: time.Second * 5}, svc.syncRoutes)
Expand Down Expand Up @@ -708,7 +708,7 @@ func (s *Service) CreateDeployment(ctx context.Context, req *connect.Request[ftl
return nil, fmt.Errorf("%s: %w", "could not create deployment", err)
}

_ = s.cronJobs.CreatedDeployment(ctx, dname, module)
s.cronJobs.CreatedDeployment(ctx, dname, module)

deploymentLogger := s.getDeploymentLogger(ctx, dname)
deploymentLogger.Debugf("Created deployment %s", dname)
Expand Down
Loading

0 comments on commit 9ade2a3

Please sign in to comment.