MCPcopy
hub / github.com/writefreely/writefreely / InsertJob

Method InsertJob

database.go:3296–3307  ·  view source on GitHub ↗
(j *PostJob)

Source from the content-addressed store, hash-verified

3294}
3295
3296func (db *datastore) InsertJob(j *PostJob) error {
3297 res, err := db.Exec("INSERT INTO publishjobs (post_id, action, delay) VALUES (?, ?, ?)", j.PostID, j.Action, j.Delay)
3298 if err != nil {
3299 return err
3300 }
3301 jobID, err := res.LastInsertId()
3302 if err != nil {
3303 log.Error("[jobs] Couldn't get last insert ID! %s", err)
3304 }
3305 log.Info("[jobs] Queued %s job #%d for post %s, delayed %d minutes", j.Action, jobID, j.PostID, j.Delay)
3306 return nil
3307}
3308
3309func (db *datastore) UpdateJobForPost(postID string, delay int64) error {
3310 _, err := db.Exec("UPDATE publishjobs SET delay = ? WHERE post_id = ?", delay, postID)

Callers 3

newPostFunction · 0.80
addPostFunction · 0.80
addJobFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected