Skip to content

Commit

Permalink
Feature Request
Browse files Browse the repository at this point in the history
- Removed dead code
- Added a method to obtain the next scheduled time

The reason for this change is to help debugging issues with timing
  • Loading branch information
moviestoreguy committed Sep 4, 2017
1 parent 42a5804 commit 1aacb3f
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions gocron.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ func (j *Job) scheduleNextRun() {
}
}

// NextScheduledTime returns the time of when this job is to run next
func (j *Job) NextScheduledTime() time.Time {
return j.nextRun
}

// the follow functions set the job's unit with seconds,minutes,hours...

// Set the unit with second
Expand Down Expand Up @@ -255,18 +260,6 @@ func (j *Job) Days() *Job {
return j
}

/*
// Set the unit with week, which the interval is 1
func (j *Job) Week() (job *Job) {
if j.interval != 1 {
panic("")
}
job = j.Weeks()
return
}
*/

// s.Every(1).Monday().Do(task)
// Set the start day with Monday
func (j *Job) Monday() (job *Job) {
Expand Down

0 comments on commit 1aacb3f

Please sign in to comment.