refactor: 重构项目,为所有的 AI 工具都引入算力,采用算力统一结算各个工具的调用次数和权限

This commit is contained in:
RockYang
2024-03-12 15:40:44 +08:00
parent 43bfac99b6
commit da2bd4a501
45 changed files with 438 additions and 298 deletions

View File

@@ -96,12 +96,6 @@ func (s *Service) Run() {
s.db.Updates(&job)
// 任务失败,通知前端
s.notifyQueue.RPush(task.UserId)
// restore img_call quota
if task.Type.String() != types.TaskUpscale.String() {
s.db.Model(&model.User{}).Where("id = ?", task.UserId).UpdateColumn("img_calls", gorm.Expr("img_calls + ?", 1))
}
// TODO: 任务提交失败,加入队列重试
continue
}
logger.Infof("任务提交成功:%+v", res)