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 }
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) // } }
func (dataW *dataWorker) Sub(job *goqless.Job) (err error) { job.Data = map[string]interface{}{"id": "Sub"} return }