forked from distribworks/dkron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One off jobs
- Loading branch information
Victor Castell
committed
Jun 2, 2016
1 parent
0a9b4de
commit b9b0e43
Showing
6 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cron | ||
|
||
import "time" | ||
|
||
// SimpleDelaySchedule represents a simple non recurring duration. | ||
type SimpleSchedule struct { | ||
Date time.Time | ||
} | ||
|
||
// Just store the given time for this schedule. | ||
func At(date time.Time) SimpleSchedule { | ||
return SimpleSchedule{ | ||
Date: date, | ||
} | ||
} | ||
|
||
// Next conforms to the Schedule interface but this kind of jobs | ||
// doesn't need to be run more than once, so it doesn't return a new date but the existing one. | ||
func (schedule SimpleSchedule) Next(t time.Time) time.Time { | ||
return schedule.Date | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters