Esempio n. 1
0
func (s *Supervisor) RunIt(job *scheduler.Job) error {
	var err error
	//log.Println(spew.Sdump(job))
	for !job.Failed() {
		err = job.Run()
		if err == nil {
			return nil
		}
	}
	return ErrExhaustedRetries
}
Esempio n. 2
0
File: etcd.go Progetto: kapalhq/mozo
// Make a job offer in: (k,v) -> ($JOB_OFFERS/$job_id , job)
func (e *EtcdProxy) MakeJobOffer(job *scheduler.Job) error {
	key := fmt.Sprintf("%s/%s", JOB_OFFER_KEY, job.Id)
	jobEncoded, _ := job.EncodeToString()
	_, err := e.etcdClient.Set(key, jobEncoded, NO_TTL)
	return err
}
Esempio n. 3
0
File: etcd.go Progetto: kapalhq/mozo
func (e *EtcdProxy) RegisterJob(job *scheduler.Job) error {
	jobEncoded, _ := job.EncodeToString()
	_, err := e.etcdClient.Set(fmt.Sprintf("%s/%s", JOB_REGISTRATION_KEY, job.Id), jobEncoded, NO_TTL)
	return err
}