Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FindJobsByTag exported #268

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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