This commit is contained in:
shoopea 2019-08-23 20:10:44 +08:00
parent 25e44c0a81
commit bb14f6a1cf

12
job.go
View File

@ -83,8 +83,8 @@ func setJobTimeout(jobID64 int64, d time.Duration) error {
} }
defer stmt.Close() defer stmt.Close()
_, err = stmt.Exec(time.Now().UTC().Add(d), jobId) _, err = stmt.Exec(time.Now().UTC().Add(d), jobID64)
s := fmt.Sprintf("setJobTimeout, update obj_job(%d)", jobId) s := fmt.Sprintf("setJobTimeout, update obj_job(%d)", jobID64)
logOnError(err, s) logOnError(err, s)
if err != nil { if err != nil {
return err return err
@ -93,7 +93,7 @@ func setJobTimeout(jobID64 int64, d time.Duration) error {
return nil return nil
} }
func setJobDone(jobId int64) error { func setJobDone(jobID64 int64) error {
stmt, err := db.Prepare(`UPDATE obj_job j SET j.is_done = 1, j.in_work = 0, j.ended = ? WHERE j.obj_id = ?;`) stmt, err := db.Prepare(`UPDATE obj_job j SET j.is_done = 1, j.in_work = 0, j.ended = ? WHERE j.obj_id = ?;`)
logOnError(err, "setJobDone : prepare update obj_job") logOnError(err, "setJobDone : prepare update obj_job")
if err != nil { if err != nil {
@ -101,8 +101,8 @@ func setJobDone(jobId int64) error {
} }
defer stmt.Close() defer stmt.Close()
_, err = stmt.Exec(time.Now().UTC(), jobId) _, err = stmt.Exec(time.Now().UTC(), jobID64)
s := fmt.Sprintf("setJobDone, update obj_job(%d)", jobId) s := fmt.Sprintf("setJobDone, update obj_job(%d)", jobID64)
logOnError(err, s) logOnError(err, s)
if err != nil { if err != nil {
return err return err
@ -762,7 +762,7 @@ func jobGDeposit(j Job) {
} }
log.Printf("jobGDeposit : Sending messages.\n") log.Printf("jobGDeposit : Sending messages.\n")
var delay int64 = 0 var delay int64 = 0
var b []string var b []byte
if res || alch || misc || craft || equip { if res || alch || misc || craft || equip {
p.Status = 1 p.Status = 1
b, _ = json.Marshal(&p) b, _ = json.Marshal(&p)