This commit is contained in:
shoopea 2020-10-11 12:57:07 +02:00
parent e0e8c2a8ae
commit f17a44d2e8

7
sql.go
View File

@ -962,15 +962,14 @@ func getSQLListID64(q string) []int64 {
func cleanupJobData() { func cleanupJobData() {
var jobID int64 var jobID int64
jobStmt, err := db.Prepare(`SELECT o.id FROM obj o WHERE o.obj_type_id = ?;`) jobStmt, err := db.Prepare(`SELECT o.id FROM obj o WHERE o.obj_type_id = ` + strconv.FormatInt(cacheObjType[`job`], 10) + `;`)
logOnError(err, "cleanupJobData : prepare jobStmt") logOnError(err, "cleanupJobData : prepare jobStmt")
if err != nil { if err != nil {
jobStmt.Close() jobStmt.Close()
return return
} }
jobID = cacheObjType[`job`] jobs, err := jobStmt.Query()
jobs, err := jobStmt.Query(&jobID)
logOnError(err, "cleanupJobData : query jobStmt") logOnError(err, "cleanupJobData : query jobStmt")
if err != nil { if err != nil {
jobStmt.Close() jobStmt.Close()
@ -978,7 +977,7 @@ func cleanupJobData() {
} }
for jobs.Next() { for jobs.Next() {
err = rows.Scan(&jobID) err = jobs.Scan(&jobID)
logOnError(err, "cleanupJobData : scan jobStmt") logOnError(err, "cleanupJobData : scan jobStmt")
if err != nil { if err != nil {
return return