This commit is contained in:
2025-11-16 21:56:46 +08:00
parent 01b6d1cc14
commit 3daa03eab2
5 changed files with 13 additions and 13 deletions

View File

@@ -154,8 +154,8 @@ func (r *gormPendingTaskRepository) ClaimNextAvailableTask(ctx context.Context,
return err
}
// 在 Preload("Tasks") 时,使用 Unscoped() 来忽略 Task 的软删除状态
if err := tx.WithContext(repoCtx).Preload("Tasks", func(db *gorm.DB) *gorm.DB {
// 在 Preload("Task") 时,使用 Unscoped() 来忽略 Task 的软删除状态
if err := tx.WithContext(repoCtx).Preload("Task", func(db *gorm.DB) *gorm.DB {
return db.Unscoped()
}).First(&log, pendingTask.TaskExecutionLogID).Error; err != nil {
return err