// Start the specified runner (used by ruby script)
Start the specified runner (used by ruby script)
// Start the specified runner ( used by ruby script )
func (s RunnerService) Start(ctx context.Context, r api.RunnerStartRequest) (*api.RunnerStartResponse, error) {
	logger := s.logger.With(zap.String("runner", r.Runner), zap.Int("runner_id", int(r.ID)))
	logger.Info("STARTING RUNNER")
	var runner api.Runner
	if err := s.DB.First(&runner, r.ID).Error; err != nil {
		logger.Error("Cannot get runner", zap.String("exception", err.Error()))
		return nil, fmt.Errorf("cannot get runner: %v", err)
	}
	now := time.Now()
	runner.Status = avian.StatusRunning
	runner.HealthyAt = &now
	runner.CaseID = r.CaseID
	if err := s.DB.Save(&runner).Error; err != nil {
		logger.Error("Cannot save the started runner", zap.String("exception", err.Error()))
		return nil, fmt.Errorf("cannot save runner: %v", err)
	}
	return &api.RunnerStartResponse{}, nil
}
func ( s RunnerService ) Start ( ctx context . Context , r api . RunnerStartRequest ) ( * api . RunnerStartResponse , error ) { logger := s . logger . With ( zap . String ( " " , r . Runner ) , zap . Int ( " " , int ( r . ID ) ) ) logger . Info ( " " ) var runner api . Runner if err := s . DB . First ( & runner , r . ID ) . Error ; err != nil { logger . Error ( " " , zap . String ( " " , err . Error ( ) ) ) return nil , fmt . Errorf ( " " , err ) } now := time . Now ( ) runner . Status = avian . StatusRunning runner . HealthyAt = & now runner . CaseID = r . CaseID if err := s . DB . Save ( & runner ) . Error ; err != nil { logger . Error ( " " , zap . String ( " " , err . Error ( ) ) ) return nil , fmt . Errorf ( " " , err ) } return & api . RunnerStartResponse { } , nil }
Start the specified runner (used by ruby script)
Start the specified runner ( used by ruby script )