wip: prepareCommand for service completed; next cron

This commit is contained in:
2024-03-24 12:54:37 +00:00
parent 8f68c4ace9
commit a63646aab2
5 changed files with 81 additions and 26 deletions
+8 -1
View File
@@ -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
}