Exemple #1
0
// UpdateTask takes a Task and updates it in Consul
func (consul *Consul) UpdateTask(task *tasks.Task) error {
	local := task.KV()
	local.Key = WithPrefix(consul.AppsPrefix, local.Key)

	// we always want to update tasks
	_, err := consul.kv.Put(local)
	return err
}
Exemple #2
0
// DeleteTask taske a Task and deletes it from Consul
func (consul *Consul) DeleteTask(task *tasks.Task) error {
	_, err := consul.kv.Delete(WithPrefix(consul.AppsPrefix, task.Key()))
	return err
}