Ejemplo n.º 1
0
func (dataW *dataWorker) Add(job *goqless.Job) (err error) {
	job.Data = map[string]interface{}{"id": "Add"}
	time.Sleep(190 * time.Second)
	job.Data = map[string]interface{}{"id": "sleepEndAdd"}

	return
}
Ejemplo n.º 2
0
func testJobMoveFailRetry(QueueNo int, job *goqless.Job) {

	//Move to self.queue
	if test_move == QueueNo {
		//return jid
		moveStr, err := job.Move("queue_name_1")
		if err != nil {
			log.Println("Move failed. err:", err)
		}
		log.Printf("moveStr:%+v", moveStr)
	}
	//Fail
	// if test_fail == QueueNo {
	// 	failRet, err := job.Fail("typ", "message")
	// 	if err != nil {
	// 		log.Println("Fail failed. err:", err)
	// 	}
	// 	log.Println("failRet:", failRet)
	// }
	//Retry
	// if test_retry == QueueNo {
	// 	delay := 0
	// 	retryStr, err := job.Retry(delay)
	// 	if err != nil {
	// 		log.Println("Retry failed. err:", err)
	// 	}
	// 	log.Println("retryStr:", retryStr, " jid:", job.Jid)
	// 	log.Printf("===jobPut:%+v", job)
	// }
}
Ejemplo n.º 3
0
func (dataW *dataWorker) Sub(job *goqless.Job) (err error) {
	job.Data = map[string]interface{}{"id": "Sub"}
	return
}