fixe page styles

This commit is contained in:
RockYang
2024-06-05 18:08:23 +08:00
parent 3c70c8ae59
commit c02661ea29
17 changed files with 95 additions and 78 deletions

View File

@@ -179,14 +179,14 @@ func (p *ServicePool) HasAvailableService() bool {
// SyncTaskProgress 异步拉取任务
func (p *ServicePool) SyncTaskProgress() {
go func() {
var items []model.MidJourneyJob
var jobs []model.MidJourneyJob
for {
res := p.db.Where("progress < ?", 100).Find(&items)
res := p.db.Where("progress < ?", 100).Find(&jobs)
if res.Error != nil {
continue
}
for _, job := range items {
for _, job := range jobs {
// 失败或者 30 分钟还没完成的任务删除并退回算力
if time.Now().Sub(job.CreatedAt) > time.Minute*30 || job.Progress == -1 {
p.db.Delete(&job)