update job
This commit is contained in:
parent
cb5a0c1640
commit
415403c33e
4
job.go
4
job.go
@ -17,6 +17,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func createJob(jobTypeID int32, priority int32, userID64 int64, trigger int64, schedule time.Time, payload []byte) (int64, error) {
|
func createJob(jobTypeID int32, priority int32, userID64 int64, trigger int64, schedule time.Time, payload []byte) (int64, error) {
|
||||||
|
if len(payload) > 20000 {
|
||||||
|
return 0, errors.New("payload too long")
|
||||||
|
}
|
||||||
|
|
||||||
stmt, err := db.Prepare(`INSERT INTO obj (obj_type_id, obj_sub_type_id)
|
stmt, err := db.Prepare(`INSERT INTO obj (obj_type_id, obj_sub_type_id)
|
||||||
VALUES (? , ?);`)
|
VALUES (? , ?);`)
|
||||||
logOnError(err, "createJob : prepare insert obj")
|
logOnError(err, "createJob : prepare insert obj")
|
||||||
|
2
sql.go
2
sql.go
@ -383,7 +383,7 @@ func initDB() {
|
|||||||
,started TIMESTAMP
|
,started TIMESTAMP
|
||||||
,ended TIMESTAMP
|
,ended TIMESTAMP
|
||||||
,timeout TIMESTAMP
|
,timeout TIMESTAMP
|
||||||
,payload VARCHAR(4000)
|
,payload VARCHAR(65532)
|
||||||
,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE
|
,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE
|
||||||
,KEY (is_done)
|
,KEY (is_done)
|
||||||
,KEY (in_work)
|
,KEY (in_work)
|
||||||
|
Loading…
Reference in New Issue
Block a user