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

Follow #30406

(cherry picked from commit 30dd4beeee631860c7dd393c341e9955997095a4)
This commit is contained in:
Zettat123 2024-04-23 11:51:52 +08:00 committed by Earl Warren
parent 4f73382e95
commit 168cb758ec
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 30 additions and 2 deletions

View file

@ -159,6 +159,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",
},
{
Name: "Topics with empty repository count",
Counter: repo_model.CountOrphanedTopics,