mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 02:33:42 +08:00
optimize code for remove timeout and failed image drawing job
This commit is contained in:
@@ -184,12 +184,7 @@ func (s *Service) Txt2Img(task types.SdTask) error {
|
||||
for {
|
||||
select {
|
||||
case err := <-errChan:
|
||||
if err != nil { // task failed
|
||||
s.db.Model(&model.SdJob{Id: uint(task.Id)}).UpdateColumns(map[string]interface{}{
|
||||
"progress": -1,
|
||||
"err_msg": err.Error(),
|
||||
})
|
||||
s.notifyQueue.RPush(NotifyMessage{UserId: task.UserId, JobId: task.Id, Message: Failed})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user