Add a db consistency check to remove runners that do not belong to a repository (#30614) (#30653)

Backport #30614
This commit is contained in:
Zettat123
2024-04-24 08:08:06 +08:00
committed by GitHub
parent 03518d3e18
commit ddf64b84e4
2 changed files with 30 additions and 2 deletions

View File

@@ -158,6 +158,12 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er
Fixer: actions_model.FixRunnersWithoutBelongingOwner,
FixedMessage: "Removed",
},
{
Name: "Action Runners without existing repository",
Counter: actions_model.CountRunnersWithoutBelongingRepo,
Fixer: actions_model.FixRunnersWithoutBelongingRepo,
FixedMessage: "Removed",
},
}
// TODO: function to recalc all counters