1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-10-20 19:52:04 +00:00

fix: a corrupted schedule task is disabled

The following errors are specific to the scheduled workflow being
handled. They do not imply the remaining scheduled workflows cannot
be scheduled successfully.

- Failure to create a scheduled task which is most likely caused
  by an invalid YAML file.
- Failure to parse the scheduling specs which can be caused by a
  number of formating errors.

Instead of returning on error, the corrupted workflow is disabled.

Also display more informative error messages so that the failed
workflow can be identified from the logged error.
This commit is contained in:
Earl Warren 2025-08-18 18:54:42 +02:00
parent f9a6657248
commit ab3cf7ddcf
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
5 changed files with 136 additions and 9 deletions

View file

@ -336,5 +336,8 @@ func getUnitsByRepoID(ctx context.Context, repoID int64) (units []*RepoUnit, err
// UpdateRepoUnit updates the provided repo unit
func UpdateRepoUnit(ctx context.Context, unit *RepoUnit) error {
_, err := db.GetEngine(ctx).ID(unit.ID).Update(unit)
return err
if err != nil {
return fmt.Errorf("UpdateRepoUnit: %v", err)
}
return nil
}