code: func NewScheduler(
  	numScrapers int,
  	l *zap.Logger,
  	targets platform.ScraperTargetStoreService,
  	p nats.Publisher,
  	s nats.Subscriber,
  	interval time.Duration,
  	timeout time.Duration,
  ) (*Scheduler, error) {
  	if interval == 0 {
  		interval = 60 * time.Second
  	}
  	if timeout == 0 {
  		timeout = 30 * time.Second
  	}
  	scheduler := &Scheduler{
  		Targets:   targets,
  		Interval:  interval,
  		Timeout:   timeout,
  		Publisher: p,
  		Logger:    l,
  		gather:    make(chan struct{}, 100),
  	}
  
  	for i := 0; i < numScrapers; i++ {
  		err := s.Subscribe(promTargetSubject, "", &handler{
  			Scraper:   new(prometheusScraper),
  			Publisher: p,
  			Logger:    l,
  		})
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	return scheduler, nil
  }
docs: // NewScheduler creates a new Scheduler and subscriptions for scraper jobs.