change run once task trigger to on registration
This commit is contained in:
parent
753242a949
commit
e6fea56198
@ -180,6 +180,10 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) {
|
|||||||
Enabled: st.Enabled,
|
Enabled: st.Enabled,
|
||||||
StartBoundary: now,
|
StartBoundary: now,
|
||||||
}
|
}
|
||||||
|
} else if st.Trigger == "runonce" {
|
||||||
|
tasktrigger = taskmaster.TaskTrigger{
|
||||||
|
Enabled: st.Enabled,
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tasktrigger = taskmaster.TaskTrigger{
|
tasktrigger = taskmaster.TaskTrigger{
|
||||||
Enabled: st.Enabled,
|
Enabled: st.Enabled,
|
||||||
@ -201,9 +205,9 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) {
|
|||||||
|
|
||||||
switch st.Trigger {
|
switch st.Trigger {
|
||||||
case "runonce":
|
case "runonce":
|
||||||
trigger = taskmaster.TimeTrigger{
|
trigger = taskmaster.RegistrationTrigger{
|
||||||
TaskTrigger: tasktrigger,
|
TaskTrigger: tasktrigger,
|
||||||
RandomDelay: st.RandomDelay,
|
Delay: st.RandomDelay,
|
||||||
}
|
}
|
||||||
|
|
||||||
case "daily":
|
case "daily":
|
||||||
|
Loading…
Reference in New Issue
Block a user