restore use power when removed not finish jobs

This commit is contained in:
RockYang
2024-07-31 16:08:46 +08:00
parent 4eaa518cf3
commit 2ac77ac39f
25 changed files with 425 additions and 487 deletions

View File

@@ -187,6 +187,14 @@ func (p *ServicePool) SyncTaskProgress() {
}
for _, job := range jobs {
// 5 分钟还没完成的任务标记为失败
if time.Now().Sub(job.CreatedAt) > time.Minute*5 {
job.Progress = 101
job.ErrMsg = "任务超时"
p.db.Updates(&job)
continue
}
if servicePlus := p.getService(job.ChannelId); servicePlus != nil {
_ = servicePlus.Notify(job)
}