feat: add funcitons manger page

This commit is contained in:
RockYang
2023-12-21 08:58:24 +08:00
parent 6e58ddf681
commit 33aebf9cb5
12 changed files with 216 additions and 190 deletions

View File

@@ -133,6 +133,9 @@ func (h *SdJobHandler) Image(c *gin.Context) {
UserId: userId,
})
// update user's img calls
h.db.Model(&model.User{}).Where("id = ?", job.UserId).UpdateColumn("img_calls", gorm.Expr("img_calls - ?", 1))
resp.SUCCESS(c)
}
@@ -177,8 +180,8 @@ func (h *SdJobHandler) JobList(c *gin.Context) {
}
if item.Progress < 100 {
// 10 分钟还没完成的任务直接删除
if time.Now().Sub(item.CreatedAt) > time.Minute*10 {
// 5 分钟还没完成的任务直接删除
if time.Now().Sub(item.CreatedAt) > time.Minute*5 {
h.db.Delete(&item)
continue
}