loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix schedule actions still running even if workflow disalbed (#26939)

Fix #26782

authored by

Lunny Xiao and committed by
GitHub
d1dca38a 1ee4882b

+10
+10
services/actions/schedule_tasks.go
··· 10 10 11 11 actions_model "code.gitea.io/gitea/models/actions" 12 12 "code.gitea.io/gitea/models/db" 13 + "code.gitea.io/gitea/models/unit" 13 14 "code.gitea.io/gitea/modules/log" 14 15 "code.gitea.io/gitea/modules/timeutil" 15 16 webhook_module "code.gitea.io/gitea/modules/webhook" ··· 44 45 return fmt.Errorf("find specs: %w", err) 45 46 } 46 47 48 + if err := specs.LoadRepos(); err != nil { 49 + return fmt.Errorf("LoadRepos: %w", err) 50 + } 51 + 47 52 // Loop through each spec and create a schedule task for it 48 53 for _, row := range specs { 49 54 // cancel running jobs if the event is push ··· 57 62 ); err != nil { 58 63 log.Error("CancelRunningJobs: %v", err) 59 64 } 65 + } 66 + 67 + cfg := row.Repo.MustGetUnit(ctx, unit.TypeActions).ActionsConfig() 68 + if cfg.IsWorkflowDisabled(row.Schedule.WorkflowID) { 69 + continue 60 70 } 61 71 62 72 if err := CreateScheduleTask(ctx, row.Schedule); err != nil {