Ejemplo n.º 1
0
func PushRecurringBegin(task, host string) (string, error) {
	lp := logpoint.LogPoint{
		RunId:    newRunId(),
		Task:     task,
		Host:     host,
		Mode:     mode.Recurring,
		Priority: priority.Informational,
		State:    state.Started,
		Time:     time.Now(),
	}
	go scheduler.RecurringTaskIncoming(lp)
	return lp.RunId, persistence.StorePoint(lp)
}
Ejemplo n.º 2
0
func PushRecurringEnd(task, host, identifier, stateStr, requestBody string) error {
	lp := logpoint.LogPoint{
		RunId:    identifier,
		Task:     task,
		Host:     host,
		Mode:     mode.Recurring,
		Priority: priority.Informational,
		State:    state.Atos(stateStr),
		Time:     time.Now(),
		Raw:      requestBody,
	}
	if lp.State != state.OK {
		idl.Warn("Recurring task unsuccessful: "+lp.Task, lp)
	}
	return persistence.StorePoint(lp)
}