test timeout

This commit is contained in:
shoopea 2019-08-29 18:44:09 +08:00
parent 144f1aba6e
commit 066d45690f

6
job.go
View File

@ -38,16 +38,16 @@ func createJob(jobTypeID int32, priority int32, userID64 int64, trigger int64, s
}
stmt, err = db.Prepare(`INSERT INTO obj_job (obj_id, priority, user_id, trigger_id, seq_nr, schedule, is_done, in_work, inserted, timeout, pulled, started, ended, payload)
VALUES (?, ?, ?, ?, NULL, ?, 0, 0, ?, ?, NULL, NULL, NULL, ?);`)
VALUES (?, ?, ?, ?, NULL, ?, 0, 0, ?, ?, NULL, NULL, NULL, ?);`)
logOnError(err, "createJob : prepare insert obj_job")
if err != nil {
return 0, err
}
defer stmt.Close()
log.Printf("createJob : timeout : %s\n.", time.Unix(maxUnixTimestamp, 0).UTC().Format(time.RFC3339))
log.Printf("createJob : timeout : %s.\n", time.Unix(maxUnixTimestamp, 0).UTC().Format(time.RFC3339))
_, err = stmt.Exec(objId, priority, userID64, trigger, schedule.UTC(), time.Now().UTC(), time.Unix(maxUnixTimestamp, 0), payload)
_, err = stmt.Exec(objId, priority, userID64, trigger, schedule.UTC(), time.Now().UTC(), time.Now().UTC(), payload)
logOnError(err, "createJob : insert obj_job")
if err != nil {
return 0, err