debug timeout

This commit is contained in:
shoopea 2019-08-29 18:38:35 +08:00
parent 5022f97e6f
commit 0de365d4f8

5
job.go
View File

@ -80,6 +80,8 @@ func setJobCallback(jobID64 int64, userID64 int64, msgTypeID64 int64) {
}
func setJobTimeout(jobID64 int64, d time.Duration) error {
log.Printf("setJobTimeout(%d) : %s.\n", jobID64, time.Now().UTC().Add(d))
stmt, err := db.Prepare(`UPDATE obj_job j SET j.timeout = ? WHERE j.obj_id = ?;`)
logOnError(err, "setJobTimeout : prepare update obj_job")
if err != nil {
@ -88,8 +90,7 @@ func setJobTimeout(jobID64 int64, d time.Duration) error {
defer stmt.Close()
_, err = stmt.Exec(time.Now().UTC().Add(d), jobID64)
s := fmt.Sprintf("setJobTimeout, update obj_job(%d)", jobID64)
logOnError(err, s)
logOnError(err, fmt.Sprintf("setJobTimeout, update obj_job(%d)", jobID64))
if err != nil {
return err
}