wip: prepareCommand for service completed; next cron
This commit is contained in:
+8
-1
@@ -1,8 +1,9 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
wminit "gitea.suyono.dev/suyono/wingmate/init"
|
||||
"time"
|
||||
|
||||
wminit "gitea.suyono.dev/suyono/wingmate/init"
|
||||
)
|
||||
|
||||
type CronSchedule struct {
|
||||
@@ -76,6 +77,7 @@ type CronTask struct {
|
||||
workingDir string
|
||||
lastRun time.Time
|
||||
hasRun bool //NOTE: make sure initialised as false
|
||||
config config
|
||||
}
|
||||
|
||||
func NewCronTask(name string) *CronTask {
|
||||
@@ -122,6 +124,11 @@ func (c *CronTask) SetSchedule(schedule CronSchedule) *CronTask {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *CronTask) SetConfig(config config) *CronTask {
|
||||
c.config = config
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *CronTask) Name() string {
|
||||
return c.name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user