mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 02:33:42 +08:00
feat: add funcitons manger page
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user