mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-11 11:43:43 +08:00
show error message for Midjourney task list page
This commit is contained in:
@@ -189,7 +189,7 @@ func (p *ServicePool) SyncTaskProgress() {
|
||||
|
||||
for _, job := range jobs {
|
||||
// 失败或者 30 分钟还没完成的任务删除并退回算力
|
||||
if time.Now().Sub(job.CreatedAt) > time.Minute*30 || job.Progress == -1 {
|
||||
if time.Now().Sub(job.CreatedAt) > time.Minute*30 {
|
||||
p.db.Delete(&job)
|
||||
// 退回算力
|
||||
tx := p.db.Model(&model.User{}).Where("id = ?", job.UserId).UpdateColumn("power", gorm.Expr("power + ?", job.Power))
|
||||
|
||||
Reference in New Issue
Block a user