wip: feat(task): added AutoStart and AutoRestart on ServiceTask

This commit is contained in:
2024-01-01 11:35:18 +11:00
parent 5bae155b3b
commit 98d57cda84
3 changed files with 109 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ import (
type Tasks interface {
List() []Task
Services() []Task
Services() []ServiceTask
Crones() []CronTask
Get(string) (Task, error)
}
@@ -25,7 +25,7 @@ type Task interface {
Environ() []string
Setsid() bool
UserGroup() UserGroup
Background() bool
Background() bool //NOTE: implies using wmpidproxy
WorkingDir() string
Status() TaskStatus
}
@@ -35,6 +35,12 @@ type CronTask interface {
TimeToRun(time.Time) bool
}
type ServiceTask interface {
Task
AutoStart() bool
AutoRestart() bool
}
type Config interface {
Tasks() Tasks
}