forked from forgejo/forgejo
parent
ae419fa494
commit
76a85a4ce9
64 changed files with 250 additions and 242 deletions
|
@ -101,9 +101,9 @@ func (t *HookTask) simpleMarshalJSON(v any) string {
|
|||
}
|
||||
|
||||
// HookTasks returns a list of hook tasks by given conditions.
|
||||
func HookTasks(hookID int64, page int) ([]*HookTask, error) {
|
||||
func HookTasks(ctx context.Context, hookID int64, page int) ([]*HookTask, error) {
|
||||
tasks := make([]*HookTask, 0, setting.Webhook.PagingNum)
|
||||
return tasks, db.GetEngine(db.DefaultContext).
|
||||
return tasks, db.GetEngine(ctx).
|
||||
Limit(setting.Webhook.PagingNum, (page-1)*setting.Webhook.PagingNum).
|
||||
Where("hook_id=?", hookID).
|
||||
Desc("id").
|
||||
|
@ -143,8 +143,8 @@ func GetHookTaskByID(ctx context.Context, id int64) (*HookTask, error) {
|
|||
}
|
||||
|
||||
// UpdateHookTask updates information of hook task.
|
||||
func UpdateHookTask(t *HookTask) error {
|
||||
_, err := db.GetEngine(db.DefaultContext).ID(t.ID).AllCols().Update(t)
|
||||
func UpdateHookTask(ctx context.Context, t *HookTask) error {
|
||||
_, err := db.GetEngine(ctx).ID(t.ID).AllCols().Update(t)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue