diff --git a/backend/controller/controller.go b/backend/controller/controller.go index 0a5ae5ace6..b2deacba3d 100644 --- a/backend/controller/controller.go +++ b/backend/controller/controller.go @@ -687,21 +687,14 @@ func (s *Service) Ping(ctx context.Context, req *connect.Request[ftlv1.PingReque return connect.NewResponse(&ftlv1.PingResponse{}), nil } - // Check if all required deployments are active. - modules, err := s.dal.GetActiveDeployments(ctx) - if err != nil { - return nil, err - } + //It's not actually ready until it is in the routes table + routes := s.routes.Load() var missing []string -nextModule: for _, module := range s.config.WaitFor { - for _, m := range modules { - replicas, ok := m.Replicas.Get() - if ok && replicas > 0 && m.Module == module { - continue nextModule - } + route, ok := routes[module] + if !ok || len(route) == 0 { + missing = append(missing, module) } - missing = append(missing, module) } if len(missing) == 0 { return connect.NewResponse(&ftlv1.PingResponse{}), nil