Skip to content

Commit

Permalink
Export FindJobsByTag (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmclean authored Dec 13, 2021
1 parent c3be44d commit 5a66869
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func (s *Scheduler) RunByTag(tag string) error {
// RunByTagWithDelay is same as RunByTag but introduces a delay between
// each job execution
func (s *Scheduler) RunByTagWithDelay(tag string, d time.Duration) error {
jobs, err := s.findJobsByTag(tag)
jobs, err := s.FindJobsByTag(tag)
if err != nil {
return err
}
Expand Down Expand Up @@ -626,7 +626,7 @@ func (s *Scheduler) RemoveByTag(tag string) error {

// RemoveByTags will remove Jobs that match all given tags.
func (s *Scheduler) RemoveByTags(tags ...string) error {
jobs, err := s.findJobsByTag(tags...)
jobs, err := s.FindJobsByTag(tags...)
if err != nil {
return err
}
Expand All @@ -637,7 +637,8 @@ func (s *Scheduler) RemoveByTags(tags ...string) error {
return nil
}

func (s *Scheduler) findJobsByTag(tags ...string) ([]*Job, error) {
// FindJobsByTag will return a slice of Jobs that match all given tags
func (s *Scheduler) FindJobsByTag(tags ...string) ([]*Job, error) {
var jobs []*Job

Jobs:
Expand Down

0 comments on commit 5a66869

Please sign in to comment.