show error message for Midjourney task list page

This commit is contained in:
RockYang
2024-07-16 17:16:58 +08:00
parent 42bc23cacf
commit a6b9f57a50
8 changed files with 95 additions and 336 deletions

View File

@@ -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))