MCPcopy Create free account
hub / github.com/gogs/gogs / GitGcRepos

Function GitGcRepos

internal/database/repo.go:2114–2131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2112}
2113
2114func GitGcRepos() error {
2115 args := append([]string{"gc"}, conf.Git.GCArgs...)
2116 return x.Where("id > 0").Iterate(new(Repository),
2117 func(idx int, bean any) error {
2118 repo := bean.(*Repository)
2119 if err := repo.GetOwner(); err != nil {
2120 return err
2121 }
2122 _, stderr, err := process.ExecDir(
2123 time.Duration(conf.Git.Timeout.GC)*time.Second,
2124 RepoPath(repo.Owner.Name, repo.Name), "Repository garbage collection",
2125 "git", args...)
2126 if err != nil {
2127 return errors.Newf("%v: %v", err, stderr)
2128 }
2129 return nil
2130 })
2131}
2132
2133type repoChecker struct {
2134 querySQL, correctSQL string

Callers 1

OperationFunction · 0.92

Calls 6

ExecDirFunction · 0.92
appendFunction · 0.85
RepoPathFunction · 0.85
IterateMethod · 0.80
WhereMethod · 0.80
GetOwnerMethod · 0.80

Tested by

no test coverage detected