suno and luma task management funtion in admin console is ready

This commit is contained in:
RockYang
2024-10-10 17:07:40 +08:00
parent ba20717a09
commit bfc1e1bc2c
17 changed files with 818 additions and 90 deletions

View File

@@ -180,12 +180,7 @@ func (h *DallJobHandler) Remove(c *gin.Context) {
// 删除任务
tx := h.DB.Begin()
if err := tx.Delete(&job).Error; err != nil {
tx.Rollback()
resp.ERROR(c, err.Error())
return
}
tx.Delete(&job)
// 如果任务未完成,或者任务失败,则恢复用户算力
if job.Progress != 100 {
err := h.userService.IncreasePower(int(job.UserId), job.Power, model.PowerLog{