This commit is contained in:
shoopea 2019-05-11 12:56:48 +08:00
parent d745d3ed27
commit 2d5415ea4e
2 changed files with 6 additions and 5 deletions

4
job.go
View File

@ -10,7 +10,7 @@ func jobRescan(j Job) {
err := setJobStart(j.ID64)
logOnError(err, "jobRescan : setJobStart")
r := JobPayloadRescanMsg{}
err = json.Unmarshal(j.payload, &r)
err = json.Unmarshal(j.Payload, &r)
ids := getSQLListID64(r.Query)
if len(ids) > 1 {
for _, id := range ids {
@ -38,7 +38,7 @@ func jobSetDone(j Job) {
err := setJobStart(j.ID64)
logOnError(err, "jobSetDone : setJobStart")
r := JobPayloadSetDone{}
err = json.Unmarshal(j.payload, &r)
err = json.Unmarshal(j.Payload, &r)
err = setJobDone(r.JobID64)
logOnError(err, "jobSetDone : setJobDone(child)")
err = setJobDone(j.ID64)

7
sql.go
View File

@ -1511,14 +1511,15 @@ func loadCurrentJobs() ([]Job, error) {
}
func getSQLListID64(q string) []int64 {
var id int64
var (
id int64
ids []int64
)
rows, err := db.Query(q)
s := fmt.Sprintf("getSQLListID64 : Query(%s)", q)
logOnError(err, s)
ids := make([]int64)
for rows.Next() {
err = rows.Scan(&id)
logOnError(err, "getSQLListID64 : scan next val")