debug timeout
This commit is contained in:
parent
5022f97e6f
commit
0de365d4f8
5
job.go
5
job.go
@ -80,6 +80,8 @@ func setJobCallback(jobID64 int64, userID64 int64, msgTypeID64 int64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setJobTimeout(jobID64 int64, d time.Duration) error {
|
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 = ?;`)
|
stmt, err := db.Prepare(`UPDATE obj_job j SET j.timeout = ? WHERE j.obj_id = ?;`)
|
||||||
logOnError(err, "setJobTimeout : prepare update obj_job")
|
logOnError(err, "setJobTimeout : prepare update obj_job")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -88,8 +90,7 @@ func setJobTimeout(jobID64 int64, d time.Duration) error {
|
|||||||
defer stmt.Close()
|
defer stmt.Close()
|
||||||
|
|
||||||
_, err = stmt.Exec(time.Now().UTC().Add(d), jobID64)
|
_, err = stmt.Exec(time.Now().UTC().Add(d), jobID64)
|
||||||
s := fmt.Sprintf("setJobTimeout, update obj_job(%d)", jobID64)
|
logOnError(err, fmt.Sprintf("setJobTimeout, update obj_job(%d)", jobID64))
|
||||||
logOnError(err, s)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user