mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 09:13:49 +08:00
feat: 提交一批插件
This commit is contained in:
@@ -2,6 +2,7 @@ package data
|
||||
|
||||
import (
|
||||
"github.com/TheTNB/panel/internal/biz"
|
||||
"github.com/TheTNB/panel/internal/job"
|
||||
"github.com/TheTNB/panel/internal/panel"
|
||||
)
|
||||
|
||||
@@ -37,3 +38,12 @@ func (r *taskRepo) Delete(id uint) error {
|
||||
func (r *taskRepo) UpdateStatus(id uint, status biz.TaskStatus) error {
|
||||
return panel.Orm.Model(&biz.Task{}).Where("id = ?", id).Update("status", status).Error
|
||||
}
|
||||
|
||||
func (r *taskRepo) Push(task *biz.Task) error {
|
||||
if err := panel.Orm.Create(task).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
return panel.Queue.Push(job.NewProcessTask(r), []any{
|
||||
task.ID,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user