Skip to content

Commit

Permalink
include runner endpoint, remove module name
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jul 18, 2024
1 parent e00d9a2 commit decd0ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1453,12 +1453,12 @@ func (s *Service) terminateRandomRunner(ctx context.Context, key model.Deploymen
func (s *Service) deploy(ctx context.Context, reconcile model.Deployment) error {
client, err := s.reserveRunner(ctx, reconcile)
if err != nil {
return fmt.Errorf("failed to reserve runner for %s %s: %w", reconcile.Key, reconcile.Module, err)
return fmt.Errorf("failed to reserve runner for %s: %w", reconcile.Key, err)
}

_, err = client.runner.Deploy(ctx, connect.NewRequest(&ftlv1.DeployRequest{DeploymentKey: reconcile.Key.String()}))
if err != nil {
return fmt.Errorf("failed to request deploy %s %s: %w", reconcile.Key, reconcile.Module, err)
return fmt.Errorf("failed to request deploy %s: %w", reconcile.Key, err)
}

return nil
Expand All @@ -1472,14 +1472,14 @@ func (s *Service) reserveRunner(ctx context.Context, reconcile model.Deployment)
"languages": []string{reconcile.Language},
})
if err != nil {
return clients{}, fmt.Errorf("failed to claim runners for %s %s: %w", reconcile.Key, reconcile.Module, err)
return clients{}, fmt.Errorf("failed to claim runners for %s: %w", reconcile.Key, err)
}

err = dal.WithReservation(reservationCtx, claim, func() error {
client = s.clientsForEndpoint(claim.Runner().Endpoint)
_, err = client.runner.Reserve(reservationCtx, connect.NewRequest(&ftlv1.ReserveRequest{DeploymentKey: reconcile.Key.String()}))
if err != nil {
return fmt.Errorf("failed to request to reserve a runner for %s %s: %w", reconcile.Key, reconcile.Module, err)
return fmt.Errorf("failed request to reserve a runner for %s at %s: %w", reconcile.Key, claim.Runner().Endpoint, err)
}

return nil
Expand Down

0 comments on commit decd0ea

Please sign in to comment.